Making WordPress.org


Ignore:
Timestamp:
01/12/2018 09:37:09 PM (8 years ago)
Author:
coffee2code
Message:

developer.wordpress.org: Append heretofore unshown @see tags from docblocks to list at end of description.

Fixes #3165.

File:
1 edited

Legend:

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

    r3626 r6383  
    1414    <h2><?php _e( 'Description', 'wporg' ); ?></h2>
    1515    <?php echo get_description(); ?>
     16
     17    <?php if ( $see = get_see_tags() ) : ?>
     18    <h3><?php _e( 'See also', 'wporg' ); ?></h3>
     19
     20    <ul>
     21    <?php
     22    foreach ( $see as $tag ) {
     23        $see_ref = '';
     24        if ( ! empty( $tag['refers'] ) ) {
     25            $see_ref .= '{@see ' . $tag['refers'] . '}';
     26        }
     27        if ( ! empty( $tag['content'] ) ) {
     28            if ( $see_ref ) {
     29                $see_ref .= ': ';
     30            }
     31            $see_ref .= $tag['content'];
     32        }
     33        // Process text for auto-linking, etc.
     34        remove_filter( 'the_content', 'wpautop' );
     35        $see_ref = apply_filters( 'the_content', apply_filters( 'get_the_content', $see_ref ) );
     36        add_filter( 'the_content', 'wpautop' );
     37   
     38        echo '<li>' . $see_ref . "</li>\n";
     39    }
     40    ?>
     41    </ul>
     42    <?php endif; ?>
    1643</section>
    1744
Note: See TracChangeset for help on using the changeset viewer.