Ticket #2558: 2558.patch
File 2558.patch, 1.4 KB (added by , 8 years ago) |
---|
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-hooks.php
7 7 public function __construct() { 8 8 // Basic behavior filters and actions. 9 9 add_filter( 'bbp_get_forum_pagination_count', '__return_empty_string' ); 10 add_action( 'pre_get_posts', array( $this, 'hide_non_public_forums' ) ); 10 11 11 12 // Display-related filters and actions. 12 13 add_filter( 'bbp_topic_admin_links', array( $this, 'admin_links' ), 10, 3 ); … … 53 54 } 54 55 55 56 /** 57 * Remove non-public forums from lists on front end. 58 * 59 * By default, bbPress shows all forums to keymasters, including private and 60 * hidden forums. This ensures that public queries include only public forums. 61 * 62 * @param WP_Query $query Current query object. 63 */ 64 function hide_non_public_forums( $query ) { 65 if ( ! is_admin() && 'forum' === $query->get( 'post_type' ) ) { 66 $query->set( 'post_status', 'publish' ); 67 } 68 } 69 70 /** 56 71 * Remove some unneeded or redundant admin links for topics and replies, 57 72 * move less commonly used inline quick links to 'Topic Admin' sidebar section. 58 73 *