Making WordPress.org

Changeset 836


Ignore:
Timestamp:
09/04/2014 07:44:44 PM (10 years ago)
Author:
coffee2code
Message:

Code Reference: temporary fix to format the display of params defined using hash notation

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

Legend:

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

    r834 r836  
    8282                    <?php endif; ?>
    8383                    <?php if ( ! empty( $param['content'] ) ) : ?>
    84                     <span class="description"><?php echo wp_kses_post( $param['content'] ); ?></span>
     84                    <span class="description"><?php echo param_formatting_fixup( wp_kses_post( $param['content'] ) ); ?></span>
    8585                    <?php endif; ?>
    8686                </p>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/content-wp-parser-hook.php

    r834 r836  
    7373
    7474                                <?php if ( ! empty( $param['content'] ) ) : ?>
    75                                     <span class="description"><?php echo wp_kses_post( $param['content'] ); ?></span>
     75                                    <span class="description"><?php echo param_formatting_fixup( wp_kses_post( $param['content'] ) ); ?></span>
    7676                                <?php endif; ?>
    7777                            </p>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php

    r833 r836  
    854854    }
    855855
     856    /**
     857     * Formats the output of params defined using hash notation.
     858     *
     859     * This is a temporary measure until the parser parses the hash notation
     860     * into component elements that the theme could then handle and style
     861     * properly.
     862     *
     863     * Also, as a stopgap this is going to begin as a barebones hack to simply
     864     * keep the text looking like one big jumble.
     865     *
     866     * @param  string $text The content for the param.
     867     * @return string
     868     */
     869    function param_formatting_fixup( $text ) {
     870        // Don't do anything if this isn't a hash notation string.
     871        if ( '{' != $text[0] ) {
     872            return $text;
     873        }
     874        $text = trim( substr( $text, 1, -1 ) );
     875        $text = str_replace( '@type', "<br \>@type", $text );
     876        return $text;
     877    }
     878
    856879}
Note: See TracChangeset for help on using the changeset viewer.