Making WordPress.org


Ignore:
Timestamp:
02/09/2024 03:15:54 AM (2 years ago)
Author:
dd32
Message:

Plugin Directory: Allow tags to be filtered by taxonomies.

This adjusts the styles and templates to simplify the behaviour, allowing for an "empty" archive to be displayed.

Closes https://github.com/WordPress/wordpress.org/pull/198.
See #7430.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/no-results.php

    r13195 r13196  
    88 */
    99
    10 ?>
     10if ( is_search() ) : ?>
    1111
    12 <section class="no-results not-found">
    13     <header class="page-header">
    14         <h1 class="page-title"><?php esc_html_e( 'Nothing Found', 'wporg-plugins' ); ?></h1>
    15     </header><!-- .page-header -->
     12    <p><?php esc_html_e( 'Sorry, but nothing matched your search terms.', 'wporg-plugins' ); ?></p>
     13    <p><?php esc_html_e( 'Please try again with some different keywords.', 'wporg-plugins' ); ?></p>
     14    <?php
     15        get_search_form();
    1616
    17     <div class="page-content">
    18         <?php if ( is_home() && current_user_can( 'publish_posts' ) ) : ?>
     17elseif ( is_tax( 'plugin_section', 'favorites' ) ) :
     18    if ( is_user_logged_in() ) :
     19        $current_user = wp_get_current_user();
     20        ?>
    1921
    20             <p>
    21                 <?php
    22                 /* translators: URL to post edit screen. */
    23                 printf( wp_kses_post( __( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'wporg-plugins' ) ), esc_url( admin_url( 'post-new.php' ) ) );
    24                 ?>
    25             </p>
     22        <p><?php esc_html_e( 'No favorites have been added, yet.', 'wporg-plugins' ); ?></p>
    2623
    27         <?php elseif ( is_search() ) : ?>
    28 
    29             <p><?php esc_html_e( 'Sorry, but nothing matched your search terms.', 'wporg-plugins' ); ?></p>
    30             <p><?php esc_html_e( 'Please try again with some different keywords.', 'wporg-plugins' ); ?></p>
    31             <?php
    32                 get_search_form();
    33 
    34         elseif ( is_tax( 'plugin_section', 'favorites' ) ) :
    35             if ( is_user_logged_in() ) :
    36                 $current_user = wp_get_current_user();
    37             ?>
    38 
    39             <p><?php esc_html_e( 'No favorites have been added, yet.', 'wporg-plugins' ); ?></p>
    40 
    41             <?php if ( get_query_var( 'favorites_user' ) === $current_user->user_nicename ) : ?>
     24        <?php if ( get_query_var( 'favorites_user' ) === $current_user->user_nicename ) : ?>
    4225            <p><?php esc_html_e( 'Find a plugin and mark it as a favorite to see it here.', 'wporg-plugins' ); ?></p>
    4326            <p>
     
    4730                ?>
    4831            </p>
    49             <?php endif; ?>
     32        <?php endif; ?>
    5033
    51             <?php else : ?>
     34    <?php else : ?>
    5235
    53             <p>
    54                 <?php
    55                 /* translators: URL to login scren. */
    56                 printf( wp_kses_post( __( '<a href="%s">Login to WordPress.org</a> to mark plugins as favorites.', 'wporg-plugins' ) ), esc_url( wp_login_url( 'https://wordpress.org/plugins/browse/favorites/' ) ) );
    57                 ?>
    58             </p>
     36        <p>
     37            <?php
     38            /* translators: URL to login scren. */
     39            printf( wp_kses_post( __( '<a href="%s">Login to WordPress.org</a> to mark plugins as favorites.', 'wporg-plugins' ) ), esc_url( wp_login_url( 'https://wordpress.org/plugins/browse/favorites/' ) ) );
     40            ?>
     41        </p>
    5942
    60         <?php
    61             endif; // is_user_logged_in.
    62         else :
    63         ?>
     43    <?php endif; // is_user_logged_in.
     44else :
     45    ?><p><?php esc_html_e( 'Sorry, but nothing matched your query.', 'wporg-plugins' ); ?></p><?php
    6446
    65             <p><?php esc_html_e( 'It seems we can&#8217;t find what you&#8217;re looking for. Perhaps searching can help.', 'wporg-plugins' ); ?></p>
    66             <?php get_search_form(); ?>
    67 
    68         <?php endif; ?>
    69     </div><!-- .page-content -->
    70 </section><!-- .no-results -->
     47endif;
Note: See TracChangeset for help on using the changeset viewer.