Changeset 6814
- Timestamp:
- 04/23/2018 04:59:08 AM (6 years ago)
- Location:
- trunk/src/includes
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/common/functions.php
r6787 r6814 13 13 // Exit if accessed directly 14 14 defined( 'ABSPATH' ) || exit; 15 16 /** 17 * Return array of bbPress registered post types 18 * 19 * @since 2.6.0 bbPress (r6813) 20 * 21 * @return array 22 */ 23 function bbp_get_post_types() { 24 return get_post_types( array( 'source' => 'bbpress' ) ); 25 } 15 26 16 27 /** URLs **********************************************************************/ -
trunk/src/includes/core/sub-actions.php
r6792 r6814 271 271 // Get bbPress post types 272 272 $post_type = get_post_type( $post ); 273 $types = get_post_types( array( 'source' => 'bbpress' ));273 $types = bbp_get_post_types(); 274 274 275 275 // Bail if post is not a bbPress post type -
trunk/src/includes/core/theme-compat.php
r6777 r6814 1011 1011 * @return bool True if open, false if closed 1012 1012 */ 1013 function bbp_force_comment_status( $open, $post_id = 0 ) { 1013 function bbp_force_comment_status( $open = false, $post_id = 0 ) { 1014 1015 // Default return value is what is passed in $open 1016 $retval = (bool) $open; 1014 1017 1015 1018 // Get the post type of the post ID 1016 1019 $post_type = get_post_type( $post_id ); 1017 1020 1018 // Default return value is what is passed in $open1019 $retval = (bool) $open;1020 1021 1021 // Only force for bbPress post types 1022 switch ( $post_type ) { 1023 case bbp_get_forum_post_type() : 1024 case bbp_get_topic_post_type() : 1025 case bbp_get_reply_post_type() : 1026 $retval = false; 1027 break; 1022 if ( in_array( $post_type, bbp_get_post_types(), true ) ) { 1023 $retval = false; 1028 1024 } 1029 1025 -
trunk/src/includes/forums/functions.php
r6784 r6814 2059 2059 2060 2060 // Some other post type besides Forums, Topics, or Replies 2061 } elseif ( ! array_diff( $post_types, get_post_types( array( 'source' => 'bbpress' )) ) ) {2061 } elseif ( ! array_diff( $post_types, bbp_get_post_types() ) ) { 2062 2062 2063 2063 // Get forums to exclude -
trunk/src/includes/search/template.php
r6745 r6814 26 26 27 27 $default_search_terms = bbp_get_search_terms(); 28 $default_post_types = get_post_types( array( 'source' => 'bbpress' ));28 $default_post_types = bbp_get_post_types(); 29 29 30 30 // Default query args
Note: See TracChangeset
for help on using the changeset viewer.