Making WordPress.org


Ignore:
Timestamp:
04/19/2016 08:15:57 PM (10 years ago)
Author:
coffee2code
Message:

developer.wordpress.org: Prevent overzealous auto-linking of hash parameter text.

Currently, hash params are part of the description text of a single parameter and are not true sub-parameters, so auto-linking the entire hash notation text blob can affect non-description aspects of hash elements (namely when a class is the expected datatype for a hash element) and mess up hash formatting.

  • Move param_formatting_fixup() to inc/formatting.php.
  • Rename param_formatting_fixup() to fix_param_hash_formatting()`.
  • In autolink_references(), don't autolink hash notation text blobs.
  • Filter param description text with fix_param_hash_formatting() via filter rather than direct call in content-reference template.
  • Call autolink_references() within fix_param_hash_formatting() for hash param item descriptions.

See https://wordpress.slack.com/archives/meta/p1460967552000043
See https://developer.wordpress.org/reference/classes/wp_customize_control/__construct/

File:
1 edited

Legend:

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

    r2779 r2984  
    6565                    <?php endif; ?>
    6666                    <?php if ( ! empty( $param['content'] ) ) : ?>
    67                     <span class="description"><?php echo param_formatting_fixup( wp_kses_post( $param['content'] ) ); ?></span>
     67                    <span class="description"><?php echo wp_kses_post( $param['content'] ); ?></span>
    6868                    <?php endif; ?>
    6969                </p>
Note: See TracChangeset for help on using the changeset viewer.