Making WordPress.org

Changeset 735


Ignore:
Timestamp:
07/02/2014 07:51:16 PM (10 years ago)
Author:
coffee2code
Message:

Code Reference: circumvent global capital_P_dangit output buffer for description of capital_P_dangit itself

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/functions.php

    r724 r735  
    5353    add_theme_support( 'automatic-feed-links' );
    5454    add_theme_support( 'post-thumbnails' );
     55
     56    add_filter( 'the_excerpt', __NAMESPACE__ . '\\lowercase_P_dangit_just_once' );
    5557
    5658    // Temporarily disable comments
     
    414416    return $status;
    415417}
     418
     419/**
     420 * Allows for "Wordpress" just for the excerpt value of the capital_P_dangit function.
     421 *
     422 * WP.org has a global output buffer that runs capital_P_dangit() over displayed
     423 * content. For this one field of this one post, circumvent that function to
     424 * to show the lowercase P.
     425 *
     426 * @param  string $excerpt The post excerpt.
     427 * @return string
     428 */
     429function lowercase_P_dangit_just_once( $excerpt ) {
     430    if ( 'wp-parser-function' == get_post_type() && 'capital_P_dangit' == get_the_title() ) {
     431        $excerpt = str_replace( 'Wordpress', 'Wordpress', $excerpt );
     432    }
     433
     434    return $excerpt;
     435}
Note: See TracChangeset for help on using the changeset viewer.