Changeset 5091
- Timestamp:
- 03/06/2017 01:07:32 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-hooks.php
r5080 r5091 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. … … 48 49 add_action( 'bbp_unapproved_topic', array( $this, 'store_moderator_username' ) ); 49 50 add_action( 'bbp_unapproved_reply', array( $this, 'store_moderator_username' ) ); 51 } 52 53 /** 54 * Remove non-public forums from lists on front end. 55 * 56 * By default, bbPress shows all forums to keymasters, including private and 57 * hidden forums. This ensures that front-end queries include only public forums. 58 * 59 * @param WP_Query $query Current query object. 60 */ 61 function hide_non_public_forums( $query ) { 62 if ( ! is_admin() && 'forum' === $query->get( 'post_type' ) ) { 63 $query->set( 'post_status', 'publish' ); 64 } 50 65 } 51 66
Note: See TracChangeset
for help on using the changeset viewer.