Making WordPress.org


Ignore:
Timestamp:
08/15/2016 05:43:19 PM (8 years ago)
Author:
coffee2code
Message:

developer.wordpress.org: For wp-parser-class, list parent class under 'Uses' and list extending classes under 'Used By'.

  • Change post_type_has_uses_info() and post_type_has_usage_info() to return true for 'wp-parser-class' post type.
  • In template-related.php, check that $uses has a value before using it.
  • In get_uses() and get_used_by()`, find classes related via the custom field '_wp-parser_extends', which notes the class being extended.

Fixes #1855.

File:
1 edited

Legend:

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

    r3660 r3809  
    2222                    $uses = get_uses();
    2323                    $uses_to_show = 5;
    24                     while ( $uses->have_posts() ) : $uses->the_post()
     24                    if ( $uses ) : while ( $uses->have_posts() ) : $uses->the_post()
    2525                        ?>
    2626                        <li>
     
    3737                            ?></a>
    3838                        <a href="#" class="hide-more"><?php _e( 'Hide more uses', 'wporg' ); ?></a>
    39                     <?php endif; ?>
     39                    <?php endif; endif; ?>
    4040                </ul>
    4141            </article>
Note: See TracChangeset for help on using the changeset viewer.