コード例 #1
0
/**
 * Author Bio shortcode filter function
 *
 * @since 1.1.0
 *
 * @param string $default_output Required. 4bzCore plugin's default shortcode output.
 * @param array $atts Optional. Options for the shortcode or widget.
 * @param array $default_opts Optional.
 */
function blogcentral_author_bio($default_output, $atts, $default_opts)
{
    // Get global variables.
    global $fourbzcore_plugin;
    global $blogcentral_opts;
    global $blogcentral_defaults;
    // Merge shortcode atts with general component layout defaults.
    $options = shortcode_atts(isset($blogcentral_defaults['posts_landing']) && is_array($blogcentral_defaults['posts_landing']) ? $blogcentral_defaults['posts_landing'] : array(), $atts, 'options');
    $options['id'] = $fourbzcore_plugin->fourbzcore_shortcode_author_bio->get_id();
    // Html fragments for classes and styles to be added to each component item.
    $wrapper = blogcentral_get_styles($options);
    $wrapper['wrapper_class'] .= ' author-bio-wrap';
    $atts = array('blogcentral_layout_opts' => $options);
    // Construct wrapper using the classes and styles previously constructed in the blogcentral_get_styles() function.
    $frag = blogcentral_construct_wrapper($wrapper);
    ob_start();
    if (isset($frag) && is_array($frag)) {
        echo $frag[0];
        $fourbzcore_plugin->fourbzcore_shortcode_author_bio->display($atts);
        echo $frag[1];
    } else {
        $fourbzcore_plugin->fourbzcore_shortcode_author_bio->display($atts);
    }
    return ob_get_clean();
}
コード例 #2
0
 /**
  * Wrapper function to create common template beginning and ending tags
  *
  * @since 1.0.0
  *
  * @param array $opts Required. Various options set on the theme's options page
  * @return array. Contains the html fragments for the beginning and ending wrapper <div>s.
  */
 function blogcentral_common_template_wrapper($opts)
 {
     $classes = blogcentral_construct_wrapper_classes_styles($opts);
     $wrapper = array('wrapper_class' => "components-wrap{$classes['layout_class']}{$classes['wrap_class']}", 'wrapper_style' => $classes['wrap_style'], 'title_text' => isset($opts['title_text']) ? $opts['title_text'] : '', 'tagline_text' => isset($opts['tagline_text']) ? $opts['tagline_text'] : '', 'title_class' => "{$classes['title_class']} {$classes['extra_class']}", 'tagline_class' => $classes['extra_tagline']);
     $frag = blogcentral_construct_wrapper($wrapper);
     return $frag;
 }