示例#1
0
 /**
  * Do actions when class is loaded
  *
  * @return void
  */
 static function on_load()
 {
     ciAddShortcode('rwmb_meta', array(__CLASS__, 'shortcode'));
 }
示例#2
0
                $image = wp_get_attachment_link($id, $size, true, false);
                break;
        }
        $output .= $i % $columns == 0 ? '<div class="row gallery-row">' : '';
        $output .= '<div class="' . $grid . '">' . $image;
        if (trim($attachment->post_excerpt)) {
            $output .= '<div class="caption hidden">' . wptexturize($attachment->post_excerpt) . '</div>';
        }
        $output .= '</div>';
        $i++;
        $output .= $i % $columns == 0 ? '</div>' : '';
    }
    $output .= $i % $columns != 0 ? '</div>' : '';
    $output .= '</div>';
    return $output;
}
if (current_theme_supports('bootstrap-gallery') && !defined('CI_IS_WP_DOT_ORG')) {
    ciRemoveShortcode('gallery');
    ciAddShortcode('gallery', 'roots_gallery');
    add_filter('use_default_gallery_style', '__return_null');
}
/**
 * Add class="thumbnail img-thumbnail" to attachment items
 */
function roots_attachment_link_class($html)
{
    $postid = get_the_ID();
    $html = str_replace('<a', '<a class="thumbnail img-thumbnail"', $html);
    return $html;
}
add_filter('wp_get_attachment_link', 'roots_attachment_link_class', 10, 1);
    }
    if ($lg) {
        $arr[] = "lg";
    }
    return $arr;
}
if (!function_exists('ciAddVisibilityBlockShortcode')) {
    function ciAddVisibilityBlockShortcode($atts, $content = "")
    {
        $availableSizes = ciGetAvailabilityArray($atts);
        $class = "";
        foreach ($availableSizes as $size) {
            $class .= "visible-{$size}";
        }
        return "<div class=\"{$class}\">" . do_shortcode($content) . "</div>";
    }
}
ciAddShortcode('visibleatsize', 'ciAddVisibilityBlockShortcode');
if (!function_exists('ciAddHiddenBlockShortcode')) {
    function ciAddHiddenBlockShortcode($atts, $content = "")
    {
        $availableSizes = ciGetAvailabilityArray($atts);
        $class = "";
        foreach ($availableSizes as $size) {
            $class .= "hidden-{$size}";
        }
        return "<div class=\"{$class}\">" . do_shortcode($content) . "</div>";
    }
}
ciAddShortcode('hiddenatsize', 'ciAddHiddenBlockShortcode');