Add namespace
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Roots\Sage\Gallery;
|
||||
|
||||
/**
|
||||
* Clean up gallery_shortcode()
|
||||
*
|
||||
@@ -7,7 +10,7 @@
|
||||
*
|
||||
* @link http://getbootstrap.com/components/#thumbnails
|
||||
*/
|
||||
function sage_gallery($attr) {
|
||||
function gallery($attr) {
|
||||
$post = get_post();
|
||||
|
||||
static $instance = 0;
|
||||
@@ -115,15 +118,15 @@ function sage_gallery($attr) {
|
||||
}
|
||||
if (current_theme_supports('bootstrap-gallery')) {
|
||||
remove_shortcode('gallery');
|
||||
add_shortcode('gallery', 'sage_gallery');
|
||||
add_shortcode('gallery', __NAMESPACE__ . '\\gallery');
|
||||
add_filter('use_default_gallery_style', '__return_null');
|
||||
}
|
||||
|
||||
/**
|
||||
* Add class="thumbnail img-thumbnail" to attachment items
|
||||
*/
|
||||
function sage_attachment_link_class($html) {
|
||||
function attachment_link_class($html) {
|
||||
$html = str_replace('<a', '<a class="thumbnail img-thumbnail"', $html);
|
||||
return $html;
|
||||
}
|
||||
add_filter('wp_get_attachment_link', 'sage_attachment_link_class', 10, 1);
|
||||
add_filter('wp_get_attachment_link', __NAMESPACE__ . '\\attachment_link_class', 10, 1);
|
||||
|
||||
Reference in New Issue
Block a user