Making WordPress.org


Ignore:
Timestamp:
12/11/2017 08:57:30 PM (8 years ago)
Author:
coffee2code
Message:

developer.wordpress.org: Move explanation content retrieval into new template tag, get_explanation_content().

File:
1 edited

Legend:

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

    r6258 r6259  
    99namespace DevHub;
    1010
    11 if ( $explanation = get_explanation_field( 'post_content', get_the_ID() ) ) :
     11if ( $explanation = get_explanation_content( get_the_ID() ) ) :
    1212    ?>
    1313    <hr />
     
    1515        <h2><?php _e( 'More Information', 'wporg' ); ?></h2>
    1616
    17         <?php
    18         // Output the explanation. Passed through 'the_content' on retrieval, thus no escaping.
    19         remove_filter( 'the_content', array( 'DevHub_Formatting', 'fix_unintended_markdown' ), 1 );
    20         global $post;
    21         $orig = $post;
    22         $post = get_explanation( get_the_ID() );
    23         echo apply_filters( 'the_content', apply_filters( 'get_the_content', $explanation ) );
    24         $post = $orig;
    25         add_filter( 'the_content', array( 'DevHub_Formatting', 'fix_unintended_markdown' ), 1 );
    26         ?>
     17        <?php echo $explanation; // Already escaped. ?>
    2718    </section>
    2819<?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.