Making WordPress.org


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

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

Explanations are stored as post_content.

File:
1 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() ) : ?>
Note: See TracChangeset for help on using the changeset viewer.