Making WordPress.org

Changeset 9894


Ignore:
Timestamp:
05/21/2020 06:40:04 AM (5 years ago)
Author:
coffee2code
Message:

Support Forums: Omit 'Create Topic' button above listings of reviews.

The rating section, which is in close proximity, already has such a button but with more context awareness.

Props dufresnesteven.
Fixes #5031.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-hooks.php

    r9880 r9894  
    622622                echo '<div class="bbp-create-topic-wrapper">';
    623623                if ( $searchform ) {
    624                     printf(
    625                         /* translators: 1: markup for forums search field which is primary action, 2: markup for button to create topic */
    626                         __( '%1$s or %2$s', 'wporg-forums' ),
    627                         $searchform,
    628                         $btn
    629                     );
     624
     625                    // Output create button alongside search form except for reviews, which already have the button in a section rendered above this one.
     626                    if( $is_reviews ) {
     627                        echo $searchform;
     628                    } else {
     629                        printf(
     630                            /* translators: 1: markup for forums search field which is primary action, 2: markup for button to create topic */
     631                            __( '%1$s or %2$s', 'wporg-forums' ),
     632                            $searchform,
     633                            $btn
     634                        );
     635                    }
    630636                } else {
    631637                    echo $btn;
Note: See TracChangeset for help on using the changeset viewer.