Making WordPress.org

Changeset 834


Ignore:
Timestamp:
09/04/2014 07:37:33 PM (11 years ago)
Author:
coffee2code
Message:

Code Reference: add 'Explanation' section to parsed content pages (if present)

Explanations are stored as post_content.

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer
Files:
2 edited

Legend:

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

    r833 r834  
    4949    <section class="meta">Used by TODO | Uses TODO | TODO Examples</section>
    5050    <?php endif; ?>
    51     <hr/>
    52     <section class="explanation">
    53         <h2><?php _e( 'Explanation', 'wporg' ); ?></h2>
    54     </section>
    5551    */ ?>
     52
     53    <?php
     54    ob_start();
     55    the_content();
     56    $explanation = ob_get_clean();
     57    if ( $explanation ) :
     58        ?>
     59        <hr/>
     60        <section class="explanation">
     61            <h2><?php _e( 'Explanation', 'wporg' ); ?></h2>
     62            <?php the_content(); ?>
     63        </section>
     64    <?php endif; ?>
    5665
    5766    <?php if ( $params = get_params() ) : ?>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/content-wp-parser-hook.php

    r833 r834  
    4141        <section class="meta">Used by TODO | Uses TODO | TODO Examples</section>
    4242        <?php endif; ?>
    43         <hr/>
    44         <section class="explanation">
    45             <h2><?php _e( 'Explanation', 'wporg' ); ?></h2>
    46         </section>
    4743        */ ?>
     44
     45        <?php
     46        ob_start();
     47        the_content();
     48        $explanation = ob_get_clean();
     49        if ( $explanation ) :
     50            ?>
     51            <hr/>
     52            <section class="explanation">
     53                <h2><?php _e( 'Explanation', 'wporg' ); ?></h2>
     54                <?php the_content(); ?>
     55            </section>
     56        <?php endif; ?>
    4857
    4958        <?php if ( $params = get_params() ) : ?>
Note: See TracChangeset for help on using the changeset viewer.