Making WordPress.org


Ignore:
Timestamp:
08/09/2016 10:52:06 PM (10 years ago)
Author:
coffee2code
Message:

developer.wordpress.org: Use a better approach to preventing fix_unintended_markdown() from running against explanations.

  • Revert [1914].
  • In get_explanation_field(), don't run value through 'the_content' filter. It's not applicable for all fields. And post_content is already passed through the filter in the template prior to display (thus this also prevents double-filtering).
  • Temporarily unhook fix_unintended_markdown() from 'the_content' filter when outputting the explanation content.
  • Hook 'the_content' for fix_unintended_markdown() at a priority of 1. Also, it's a filter, not an action.

See #1250.

File:
1 edited

Legend:

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

    r3660 r3796  
    1717                <?php
    1818                // Output the explanation. Passed through 'the_content' on retrieval, thus no escaping.
     19                remove_filter( 'the_content', array( 'DevHub_Formatting', 'fix_unintended_markdown' ), 1 );
    1920                echo apply_filters( 'the_content', apply_filters( 'get_the_content', $explanation ) );
     21                add_filter( 'the_content', array( 'DevHub_Formatting', 'fix_unintended_markdown' ), 1 );
    2022                ?>
    2123        </section>
Note: See TracChangeset for help on using the changeset viewer.