Making WordPress.org


Ignore:
Timestamp:
09/05/2022 05:14:31 AM (4 years ago)
Author:
dufresnesteven
Message:

wporg-developer: Sync with ​https://github.com/WordPress/wporg-developer/commit/790d402933d2725374de0d19e6bf6a576c8b15d2

File:
1 edited

Legend:

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

    r7491 r12050  
    1717        $used_by_to_show = 5;
    1818
     19        if ( $has_uses ) {
     20                $uses_to_show = min( $uses_to_show, split_uses_by_frequent_funcs( $uses->posts ) );
     21        }
     22
    1923        if ( $has_uses || $has_used_by ) :
    2024        ?>
    … …  
    2630                        <article class="uses">
    2731                                <h3><?php _e( 'Uses', 'wporg' ); ?></h3>
    28                                 <table id="uses-table">
     32                                <table id="uses-table" data-show="<?php echo esc_attr( $uses_to_show ) ?>">
    2933                                        <caption class="screen-reader-text"><?php esc_html_e( 'Uses', 'wporg' ); ?></caption>
    3034                                        <thead>
    … …  
    3741                                                <?php while ( $uses->have_posts() ) : $uses->the_post(); ?>
    3842                                                <tr>
    39                                                         <td>
    40                                                                 <span><?php echo esc_attr( get_source_file() ); ?>:</span>
     43                                                        <td class="related-title">
    4144                                                                <a href="<?php the_permalink(); ?>"><?php the_title(); ?><?php if ( ! in_array( get_post_type(), array( 'wp-parser-class', 'wp-parser-hook' ), true ) ) : ?>()<?php endif; ?></a>
     45                                                                <span><?php echo esc_attr( get_source_file() ); ?></span>
    4246                                                        </td>
    4347                                                        <td class="related-desc">
    … …  
    5256                                <a href="#" class="show-more"><?php
    5357                                        /* translators: %d: remaining 'uses' count */
    54                                         printf( _n( 'Show %d more use', 'Show %d more uses', $uses->post_count - $uses_to_show, 'wporg' ),
     58                                        printf( _n( 'Show %s more use', 'Show %s more uses', $uses->post_count - $uses_to_show, 'wporg' ),
    5559                                                number_format_i18n( $uses->post_count - $uses_to_show )
    5660                                        );
    … …  
    6670                        <article class="used-by">
    6771                                <h3><?php esc_html_e( 'Used By', 'wporg' ); ?></h3>
    68                                 <table id="used-by-table">
     72                                <table id="used-by-table" data-show="<?php echo esc_attr( $used_by_to_show ) ?>">
    6973                                        <caption class="screen-reader-text"><?php esc_html_e( 'Used By', 'wporg' ); ?></caption>
    7074                                        <thead>
    … …  
    7781                                                <?php while ( $used_by->have_posts() ) : $used_by->the_post(); ?>
    7882                                                <tr>
    79                                                         <td>
    80                                                                 <span><?php echo esc_attr( get_source_file() ); ?>:</span>
     83                                                        <td class="related-title">
    8184                                                                <a href="<?php the_permalink(); ?>"><?php the_title(); ?><?php if ( ! in_array( get_post_type(), array( 'wp-parser-class', 'wp-parser-hook' ), true ) ) : ?>()<?php endif; ?></a>
     85                                                                        <span><?php echo esc_attr( get_source_file() ); ?></span>
    8286                                                        </td>
    8387                                                        <td class="related-desc">
    … …  
    9296                                <a href="#" class="show-more"><?php
    9397                                        /* translators: %d: remaining 'used by' count */
    94                                         printf( _n( 'Show %d more used by', 'Show %d more used by', $used_by->post_count - $used_by_to_show, 'wporg' ),
     98                                        printf( _n( 'Show %s more used by', 'Show %s more used by', $used_by->post_count - $used_by_to_show, 'wporg' ),
    9599                                                number_format_i18n( $used_by->post_count - $used_by_to_show )
    96100                                        );
Note: See TracChangeset for help on using the changeset viewer.