Making WordPress.org

Changeset 9302


Ignore:
Timestamp:
11/27/2019 12:06:32 AM (7 years ago)
Author:
dd32
Message:

Support: Remove the Subscribe-to-forum links.

See #4782.

File:
1 edited

Legend:

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

    r9301 r9302  
    5555                add_filter( 'bbp_get_forum_subscribers', '__return_empty_array' ); // bbPress 2.5; 2.6 deprecated
    5656                add_filter( 'bbp_get_subscribers', array( $this, 'bbp_get_subscribers' ), 10, 3 ); // bbPress 2.6
     57                add_filter( 'bbp_get_user_subscribe_link', array( $this, 'bbp_get_user_subscribe_link' ), 10, 4 ); // Remove link.
    5758        }
    5859
     
    477478                return $user_ids;
    478479        }
     480
     481        /**
     482         * Disable the 'Subscribe' link for forums.
     483         */
     484        function bbp_get_user_subscribe_link( $html, $r, $user_id, $object_id ) {
     485                // We don't want end-users accidentally subscribing to a forum, lets remove those links.
     486                if ( bbp_is_forum( $object_id ) ) {
     487                        $html = '';
     488                }
     489
     490                return $html;
     491        }
    479492}
Note: See TracChangeset for help on using the changeset viewer.