Changeset 2980
- Timestamp:
- 04/03/2011 06:44:19 AM (15 years ago)
- Location:
- branches/plugin/bbp-includes
- Files:
-
- 4 edited
-
bbp-general-functions.php (modified) (4 diffs)
-
bbp-general-template.php (modified) (7 diffs)
-
bbp-reply-template.php (modified) (2 diffs)
-
bbp-widgets.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-general-functions.php
r2978 r2980 187 187 */ 188 188 function bbp_get_paged() { 189 if ( $paged = get_query_var( 'paged' ) ) 189 190 // Make sure to not paginate widget queries 191 if ( !bbp_is_query_name( 'bbp_widget' ) && ( $paged = get_query_var( 'paged' ) ) ) 190 192 return (int) $paged; 191 193 194 // Default to first page 192 195 return 1; 193 196 } … … 839 842 * @uses apply_filters() Calls 'enable_edit_any_user_configuration' with true 840 843 * @uses wp_die() To die 841 * @uses bbp_ get_query_name() To get the query name and check if it's 'bbp_widget'844 * @uses bbp_is_query_name() Check if query name is 'bbp_widget' 842 845 * @uses bbp_get_view_query_args() To get the view query args 843 846 * @uses bbp_get_topic_post_type() To get the topic post type … … 915 918 916 919 // Make sure 404 is not set 917 $posts_query->is_404 = false;920 $posts_query->is_404 = false; 918 921 919 922 // Correct is_home variable … … 924 927 925 928 // Set author_name as current user's nicename to get correct posts 926 if ( 'bbp_widget' != bbp_get_query_name() )929 if ( !bbp_is_query_name( 'bbp_widget' ) ) 927 930 $posts_query->query_vars['author_name'] = $user->user_nicename; 928 931 -
branches/plugin/bbp-includes/bbp-general-template.php
r2974 r2980 217 217 * to true. 218 218 * @uses bbp_is_user_profile_page() To check if it's the user profile page 219 * @uses bbp_ get_query_name() To get the query name219 * @uses bbp_is_query_name() To get the query name 220 220 * @return bool True if it's the favorites page, false if not 221 221 */ … … 224 224 return false; 225 225 226 if ( !empty( $query_name_check ) && ( 'bbp_user_profile_favorites' != bbp_get_query_name() ) )226 if ( !empty( $query_name_check ) && ( !bbp_is_query_name( 'bbp_user_profile_favorites' ) ) ) 227 227 return false; 228 228 … … 240 240 * to true. 241 241 * @uses bbp_is_user_profile_page() To check if it's the user profile page 242 * @uses bbp_ get_query_name() To get the query name242 * @uses bbp_is_query_name() To get the query name 243 243 * @return bool True if it's the subscriptions page, false if not 244 244 */ … … 247 247 return false; 248 248 249 if ( !empty( $query_name_check ) && ( 'bbp_user_profile_subscriptions' != bbp_get_query_name() ) )249 if ( !empty( $query_name_check ) && ( !bbp_is_query_name( 'bbp_user_profile_subscriptions' ) ) ) 250 250 return false; 251 251 … … 264 264 * to true. 265 265 * @uses bbp_is_user_profile_page() To check if it's the user profile page 266 * @uses bbp_ get_query_name() To get the query name266 * @uses bbp_is_query_name() To get the query name 267 267 * @return bool True if it's the topics created page, false if not 268 268 */ … … 271 271 return false; 272 272 273 if ( !empty( $query_name_check ) && ( 'bbp_user_profile_topics_created' != bbp_get_query_name() ) )273 if ( !empty( $query_name_check ) && ( !bbp_is_query_name( 'bbp_user_profile_topics_created' ) ) ) 274 274 return false; 275 275 … … 994 994 995 995 /** 996 * Check the passed parameter against the current _bbp_query_name 997 * 998 * @since bbPress (r2780) 999 * 1000 * @uses bbp_get_query_name() Get the query var '_bbp_query_name' 1001 * @return bool True if match, false if not 1002 */ 1003 function bbp_is_query_name( $query_name ) { 1004 1005 // No empties 1006 if ( empty( $query_name ) ) 1007 return false; 1008 1009 // Check if query var matches 1010 if ( bbp_get_query_name() == $query_name ) 1011 return true; 1012 1013 // No match 1014 return false; 1015 } 1016 1017 /** 996 1018 * Get the '_bbp_query_name' setting 997 1019 * -
branches/plugin/bbp-includes/bbp-reply-template.php
r2974 r2980 62 62 63 63 // Query only by post_parent 64 'post_parent' => bbp_ get_topic_id(),64 'post_parent' => bbp_is_topic() ? bbp_get_topic_id() : 'any', 65 65 66 66 // Narrow query down to bbPress replies … … 71 71 } else { 72 72 73 $parent_args = array( 73 // Skip topic_id if in the replies widget query 74 if ( !bbp_is_query_name( 'bbp_widget' ) ) { 74 75 75 76 // Query by post meta instead of post_parent 76 'meta_key' => '_bbp_topic_id', 77 'meta_value' => bbp_get_topic_id(), 78 79 // Include both topic and reply in the loop 80 'post_type' => array( bbp_get_topic_post_type(), bbp_get_reply_post_type() ) 81 ); 82 83 // Manually set the post_parent variable 84 $post_parent = bbp_get_topic_id(); 77 $parent_args['meta_key'] = '_bbp_topic_id'; 78 $parent_args['meta_value'] = bbp_get_topic_id(); 79 80 // Manually set the post_parent variable 81 $post_parent = bbp_get_topic_id(); 82 } 83 84 // Include both topic and reply in the loop 85 $parent_args['post_type'] = array( bbp_get_topic_post_type(), bbp_get_reply_post_type() ); 86 85 87 } 86 88 -
branches/plugin/bbp-includes/bbp-widgets.php
r2970 r2980 495 495 * @param array $instance 496 496 * @uses apply_filters() Calls 'bbp_reply_widget_title' with the title 497 * @uses bbp_set_query_name() To set the query name to 'bbp_widget' 498 * @uses bbp_reset_query_name() To reset the query name 497 499 * @uses bbp_has_replies() The main reply loop 498 500 * @uses bbp_replies() To check whether there are more replies available
Note: See TracChangeset
for help on using the changeset viewer.