Changeset 9663
- Timestamp:
- 03/31/2020 11:17:28 PM (5 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-directory-compat.php
r9621 r9663 313 313 add_action( 'wporg_compat_before_single_view', array( $this, 'do_view_header' ) ); 314 314 add_action( 'wporg_compat_before_single_view', array( $this, 'do_subscription_link' ), 11 ); 315 add_action( 'wporg_compat_before_single_view', array( $this, 'do_search_form' ), 11 );316 315 317 316 // Add output filters and actions. … … 793 792 794 793 /** 795 * Display a project-specific search form in compat views.796 */797 function do_search_form() {798 get_search_form();799 }800 801 /**802 794 * Term subscriptions use `get_term_link` for the redirect. This needs to be 803 795 * filtered to redirect to the appropriate theme/plugin support view. -
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-hooks.php
r9612 r9663 607 607 bbp_is_single_view() && in_array( bbp_get_view_id(), array( 'plugin', 'reviews', 'theme' ) ) 608 608 ) { 609 $btn = null; 609 610 $is_reviews = 'reviews' === bbp_get_view_id(); 611 610 612 if ( bbp_current_user_can_access_create_topic_form() ) { 611 printf(612 '<a class="button create-topic" href="#new-topic-0">%s</a>',613 $btn = sprintf( 614 '<a class="button button-secondary create-topic" href="#new-topic-0">%s</a>', 613 615 $is_reviews ? __( 'Create Review', 'wporg-forums' ) : __( 'Create Topic', 'wporg-forums' ) 614 616 ); 615 617 } elseif ( ! bbp_is_forum_closed() && ! is_user_logged_in() ) { 616 printf(617 '<a class="button create-topic login" href="%s">%s</a>',618 $btn = sprintf( 619 '<a class="button button-secondary create-topic login" href="%s">%s</a>', 618 620 wp_login_url(), 619 621 $is_reviews ? __( 'Log in to Create a Review', 'wporg-forums' ) : __( 'Log in to Create a Topic', 'wporg-forums' ) 620 622 ); 623 } 624 625 if ( $btn ) { 626 $searchform = get_search_form( [ 'echo' => false ] ); 627 628 echo '<div class="bbp-create-topic-wrapper">'; 629 if ( $searchform ) { 630 printf( 631 /* translators: 1: markup for forums search field which is primary action, 2: markup for button to create topic */ 632 __( '%1$s or %2$s', 'wporg-forums' ), 633 $searchform, 634 $btn 635 ); 636 } else { 637 echo $btn; 638 } 639 echo "</div>\n"; 621 640 } 622 641
Note: See TracChangeset
for help on using the changeset viewer.