示例#1
0
/** 
 * Implement 'wp_title' filter after WPSEO_Frontend::title
 * 
 */
function genesis_hm_wp_title($title, $sep, $seplocation)
{
    if (false !== strpos($title, "[")) {
        do_action("oik_add_shortcodes");
        $title = bw_do_shortcode($title);
        $title = strip_tags($title);
    }
    return $title;
}
示例#2
0
/**
 * Display information about a blog in a particular format
 *
 * 
 */
function bw_display_blog($id, $atts, $content)
{
    $bloginfo = bw_get_bloginfo($id);
    if ($bloginfo) {
        if (is_numeric($id)) {
            $url = get_blogaddress_by_id($id);
        } else {
            $url = get_blogaddress_by_name($id);
        }
        $blog = $bloginfo->blog_id;
        switch_to_blog($blog);
        if ($content) {
            e(bw_do_shortcode($content));
        } else {
            alink(null, $url, $bloginfo->blogname);
        }
        restore_current_blog();
    }
}
示例#3
0
/**
 * Implement [29608] shortcode.
 *
 * Displays a form which you can use to enter content 
 * and see the results of 'the_content' filtering before and
 * after the implementation of a fix for TRAC 29608
 *
 * Output
 *
 * - input area
 * - information area for shortcode expansion options
 * - output area showing pre 29608 output - i.e. the original 'expected' output
 * - output area displaying post 29608 output - the new 'expected' output
 * - output area showing how pre 29608 output formats
 * - output area showing how post 29608 output format
 * 
 * If there are differences 
 * - output area showing the hexadecimal dump of the original output
 * - output area showing the hexadecimal dump of the new output
 * 
 * Notes: Since the intended logic for TRAC 29608 is to perform autop processing after shortcode expansion
 * rather than before, and since this code is being run as a shortcode
 * then the whole of this output would normally be affected by the filters that run subsequently.
 * This makes a mockery of the processing. 
 * We call trac_29608_disable_remaining_filters() to prevent this from happening.
 *  
 */
function trac_29608($atts = null, $content = null, $tag = null)
{
    $value = bw_array_get($_REQUEST, "input_29608", "Code is poetry");
    define('WP_INSTALLING', true);
    $pre_29608_result = trac_pre_29608($value);
    $post_29608_result = trac_post_29608($value);
    h3("Results");
    $match = trac_29608_compare($pre_29608_result, $post_29608_result);
    e(bw_do_shortcode("[div class=w50p5]"));
    $version = bw_wp(array("v"));
    h3($version);
    trac_29608_input($pre_29608_result);
    ediv();
    //sdiv( "w50p0" );
    e(bw_do_shortcode("[div class=w50p0]"));
    h3("autopia");
    trac_29608_input($post_29608_result);
    ediv();
    sediv("cleared");
    e("<hr />");
    e(bw_do_shortcode("[div class=w50p0]"));
    trac_29608_display($pre_29608_result);
    ediv();
    e(bw_do_shortcode("[div class=w50p0]"));
    trac_29608_display($post_29608_result);
    ediv();
    sediv("cleared");
    //if ( !$match ) {
    h3("Hex dump");
    trac_29608_dump($pre_29608_result);
    trac_29608_dump($post_29608_result);
    //}
    h3("Performance comparison");
    trac_29608_perf($value);
    $bw_ret = bw_ret();
    trac_29608_form($value);
    $bw_ret_form = bw_ret();
    $bw_ret = $bw_ret_form . $bw_ret;
    trac_29608_disable_remaining_filters();
    bw_trace2($bw_ret, "bw_ret", false);
    return $bw_ret;
}