Ticket #3399: 3399.01.patch
File 3399.01.patch, 22.6 KB (added by , 13 years ago) |
---|
-
bp-activity/bp-activity-actions.php
add_action( 'bp_actions', 'bp_activity_action_remove_favorite' ); 241 241 function bp_activity_action_sitewide_feed() { 242 242 global $bp, $wp_query; 243 243 244 if ( !bp_is_ current_component( 'activity') || !bp_is_current_action( 'feed' ) || bp_is_user() || !empty( $bp->groups->current_group ) )244 if ( !bp_is_activity_component() || !bp_is_current_action( 'feed' ) || bp_is_user() || !empty( $bp->groups->current_group ) ) 245 245 return false; 246 246 247 247 $wp_query->is_404 = false; … … add_action( 'bp_actions', 'bp_activity_action_sitewide_feed' ); 255 255 function bp_activity_action_personal_feed() { 256 256 global $bp, $wp_query; 257 257 258 if ( !bp_is_ current_component( 'activity') || !bp_is_user() || !bp_is_current_action( 'feed' ) )258 if ( !bp_is_activity_component() || !bp_is_user() || !bp_is_current_action( 'feed' ) ) 259 259 return false; 260 260 261 261 $wp_query->is_404 = false; … … add_action( 'bp_actions', 'bp_activity_action_personal_feed' ); 269 269 function bp_activity_action_friends_feed() { 270 270 global $bp, $wp_query; 271 271 272 if ( !bp_is_active( 'friends' ) || !bp_is_ current_component( 'activity') || !bp_is_user() || !bp_is_current_action( bp_get_friends_slug() ) || !bp_is_action_variable( 'feed', 0 ) )272 if ( !bp_is_active( 'friends' ) || !bp_is_activity_component() || !bp_is_user() || !bp_is_current_action( bp_get_friends_slug() ) || !bp_is_action_variable( 'feed', 0 ) ) 273 273 return false; 274 274 275 275 $wp_query->is_404 = false; … … add_action( 'bp_actions', 'bp_activity_action_friends_feed' ); 283 283 function bp_activity_action_my_groups_feed() { 284 284 global $bp, $wp_query; 285 285 286 if ( !bp_is_active( 'groups' ) || !bp_is_ current_component( 'activity') || !bp_is_user() || !bp_is_current_action( bp_get_groups_slug() ) || !bp_is_action_variable( 'feed', 0 ) )286 if ( !bp_is_active( 'groups' ) || !bp_is_activity_component() || !bp_is_user() || !bp_is_current_action( bp_get_groups_slug() ) || !bp_is_action_variable( 'feed', 0 ) ) 287 287 return false; 288 288 289 289 $wp_query->is_404 = false; … … add_action( 'bp_actions', 'bp_activity_action_my_groups_feed' ); 297 297 function bp_activity_action_mentions_feed() { 298 298 global $bp, $wp_query; 299 299 300 if ( !bp_is_ current_component( 'activity') || !bp_is_user() || !bp_is_current_action( 'mentions' ) || !bp_is_action_variable( 'feed', 0 ) )300 if ( !bp_is_activity_component() || !bp_is_user() || !bp_is_current_action( 'mentions' ) || !bp_is_action_variable( 'feed', 0 ) ) 301 301 return false; 302 302 303 303 $wp_query->is_404 = false; … … add_action( 'bp_actions', 'bp_activity_action_mentions_feed' ); 311 311 function bp_activity_action_favorites_feed() { 312 312 global $bp, $wp_query; 313 313 314 if ( !bp_is_ current_component( 'activity') || !bp_is_user() || !bp_is_current_action( 'favorites' ) || !bp_is_action_variable( 'feed', 0 ) )314 if ( !bp_is_activity_component() || !bp_is_user() || !bp_is_current_action( 'favorites' ) || !bp_is_action_variable( 'feed', 0 ) ) 315 315 return false; 316 316 317 317 $wp_query->is_404 = false; -
bp-core/bp-core-template.php
function bp_action_variables() { 494 494 */ 495 495 function bp_action_variable( $position = 0 ) { 496 496 $action_variables = bp_action_variables(); 497 497 498 498 $action_variable = isset( $action_variables[$position] ) ? $action_variables[$position] : false; 499 499 500 500 return apply_filters( 'bp_action_variable', $action_variable, $position ); 501 501 } 502 502 … … function bp_is_current_action( $action = '' ) { 748 748 * @param int $position The array key you're testing against. If you don't provide a $position, 749 749 * the function will return true if the $action_variable is found *anywhere* in the action 750 750 * variables array. 751 * @return bool 751 * @return bool 752 752 */ 753 753 function bp_is_action_variable( $action_variable = '', $position = false ) { 754 754 $is_action_variable = false; 755 755 756 756 if ( false !== $position ) { 757 // When a $position is specified, check that slot in the action_variables array 757 // When a $position is specified, check that slot in the action_variables array 758 758 if ( $action_variable ) { 759 759 $is_action_variable = $action_variable == bp_action_variable( $position ); 760 760 } else { … … function bp_is_action_variable( $action_variable = '', $position = false ) { 766 766 // When no $position is specified, check the entire array 767 767 $is_action_variable = in_array( $action_variable, (array)bp_action_variables() ); 768 768 } 769 769 770 770 return apply_filters( 'bp_is_action_variable', $is_action_variable, $action_variable, $position ); 771 771 } 772 772 … … function bp_is_directory() { 825 825 */ 826 826 function bp_is_root_component( $component_name ) { 827 827 global $bp; 828 828 829 829 if ( !isset( $bp->active_components ) ) 830 830 return false; 831 831 … … function bp_is_settings_component() { 966 966 function bp_is_single_activity() { 967 967 global $bp; 968 968 969 if ( bp_is_ current_component( 'activity') && is_numeric( $bp->current_action ) )969 if ( bp_is_activity_component() && is_numeric( $bp->current_action ) ) 970 970 return true; 971 971 972 972 return false; … … function bp_is_user() { 997 997 function bp_is_user_activity() { 998 998 global $bp; 999 999 1000 if ( bp_is_ current_component( 'activity') )1000 if ( bp_is_activity_component() && bp_is_user() ) 1001 1001 return true; 1002 1002 1003 1003 return false; … … function bp_is_user_activity() { 1006 1006 function bp_is_user_friends_activity() { 1007 1007 global $bp; 1008 1008 1009 if ( bp_is_ current_component( 'activity') && bp_is_current_action( 'my-friends' ) )1009 if ( bp_is_activity_component() && bp_is_current_action( 'my-friends' ) ) 1010 1010 return true; 1011 1011 1012 1012 return false; … … function bp_is_user_friends_activity() { 1015 1015 function bp_is_user_profile() { 1016 1016 global $bp; 1017 1017 1018 if ( bp_is_ current_component( 'xprofile') || bp_is_current_component( 'profile' ) )1018 if ( bp_is_profile_component() || bp_is_current_component( 'profile' ) ) 1019 1019 return true; 1020 1020 1021 1021 return false; … … function bp_is_user_profile() { 1024 1024 function bp_is_user_profile_edit() { 1025 1025 global $bp; 1026 1026 1027 if ( bp_is_ current_component( 'xprofile') && bp_is_current_action( 'edit' ) )1027 if ( bp_is_profile_component() && bp_is_current_action( 'edit' ) ) 1028 1028 return true; 1029 1029 1030 1030 return false; 1031 1031 } 1032 1032 1033 1033 function bp_is_user_change_avatar() { 1034 1034 global $bp; 1035 1035 1036 if ( bp_is_ current_component( 'xprofile') && bp_is_current_action( 'change-avatar' ) )1036 if ( bp_is_profile_component() && bp_is_current_action( 'change-avatar' ) ) 1037 1037 return true; 1038 1038 1039 1039 return false; … … function bp_is_user_change_avatar() { 1042 1042 function bp_is_user_forums() { 1043 1043 global $bp; 1044 1044 1045 if ( bp_is_ current_component( 'forums') )1045 if ( bp_is_forums_component() && bp_is_user() ) 1046 1046 return true; 1047 1047 1048 1048 return false; … … function bp_is_user_forums() { 1051 1051 function bp_is_user_groups() { 1052 1052 global $bp; 1053 1053 1054 if ( bp_is_ current_component( 'groups') )1054 if ( bp_is_groups_component() && bp_is_user() ) 1055 1055 return true; 1056 1056 1057 1057 return false; … … function bp_is_user_groups() { 1060 1060 function bp_is_user_blogs() { 1061 1061 global $bp; 1062 1062 1063 if ( is_multisite() && bp_is_current_component( 'blogs') )1063 if ( bp_is_blogs_component() && bp_is_user() ) 1064 1064 return true; 1065 1065 1066 1066 return false; … … function bp_is_user_blogs() { 1069 1069 function bp_is_user_recent_posts() { 1070 1070 global $bp; 1071 1071 1072 if ( is_multisite() && bp_is_current_component( 'blogs') && bp_is_current_action( 'recent-posts' ) )1072 if ( bp_is_blogs_component() && bp_is_current_action( 'recent-posts' ) ) 1073 1073 return true; 1074 1074 1075 1075 return false; … … function bp_is_user_recent_posts() { 1078 1078 function bp_is_user_recent_commments() { 1079 1079 global $bp; 1080 1080 1081 if ( is_multisite() && bp_is_current_component( 'blogs') && bp_is_current_action( 'recent-comments' ) )1081 if ( bp_is_blogs_component() && bp_is_current_action( 'recent-comments' ) ) 1082 1082 return true; 1083 1083 1084 1084 return false; … … function bp_is_user_recent_commments() { 1086 1086 1087 1087 function bp_is_user_friends() { 1088 1088 1089 if ( bp_is_ current_component( 'friends') )1089 if ( bp_is_friends_component() && bp_is_user() ) 1090 1090 return true; 1091 1091 1092 1092 return false; … … function bp_is_user_friends() { 1095 1095 function bp_is_user_friend_requests() { 1096 1096 global $bp; 1097 1097 1098 if ( bp_is_ current_component( 'friends') && bp_is_current_action( 'requests' ) )1098 if ( bp_is_friends_component() && bp_is_current_action( 'requests' ) ) 1099 1099 return true; 1100 1100 1101 1101 return false; … … function bp_is_group_single() { 1221 1221 function bp_is_create_blog() { 1222 1222 global $bp; 1223 1223 1224 if ( is_multisite() && bp_is_current_component( 'blogs') && bp_is_current_action( 'create' ) )1224 if ( bp_is_blogs_component() && bp_is_current_action( 'create' ) ) 1225 1225 return true; 1226 1226 1227 1227 return false; … … function bp_is_create_blog() { 1231 1231 1232 1232 function bp_is_user_messages() { 1233 1233 1234 if ( bp_is_ current_component( 'messages') )1234 if ( bp_is_messages_component() && bp_is_user() ) 1235 1235 return true; 1236 1236 1237 1237 return false; … … function bp_is_user_messages() { 1240 1240 function bp_is_messages_inbox() { 1241 1241 global $bp; 1242 1242 1243 if ( bp_is_ current_component( 'messages') && ( !bp_current_action() || bp_is_current_action( 'inbox' ) ) )1243 if ( bp_is_messages_component() && ( !bp_current_action() || bp_is_current_action( 'inbox' ) ) ) 1244 1244 return true; 1245 1245 1246 1246 return false; … … function bp_is_messages_inbox() { 1249 1249 function bp_is_messages_sentbox() { 1250 1250 global $bp; 1251 1251 1252 if ( bp_is_ current_component( 'messages') && bp_is_current_action( 'sentbox' ) )1252 if ( bp_is_messages_component() && bp_is_current_action( 'sentbox' ) ) 1253 1253 return true; 1254 1254 1255 1255 return false; … … function bp_is_messages_sentbox() { 1258 1258 function bp_is_messages_compose_screen() { 1259 1259 global $bp; 1260 1260 1261 if ( bp_is_ current_component( 'messages') && bp_is_current_action( 'compose' ) )1261 if ( bp_is_messages_component() && bp_is_current_action( 'compose' ) ) 1262 1262 return true; 1263 1263 1264 1264 return false; … … function bp_is_messages_compose_screen() { 1267 1267 function bp_is_notices() { 1268 1268 global $bp; 1269 1269 1270 if ( bp_is_ current_component( 'messages') && bp_is_current_action( 'notices' ) )1270 if ( bp_is_messages_component() && bp_is_current_action( 'notices' ) ) 1271 1271 return true; 1272 1272 1273 1273 return false; -
bp-forums/bp-forums-template.php
class BP_Forums_Template_Forum { 101 101 $this->__construct( $type, $forum_id, $user_id, $page, $per_page, $max, $no_stickies, $search_terms, $offset, $number ); 102 102 } 103 103 104 function __construct( $type, $forum_id, $user_id, $page, $per_page, $max, $no_stickies, $search_terms, $offset = false, $number = false ) { 104 function __construct( $type, $forum_id, $user_id, $page, $per_page, $max, $no_stickies, $search_terms, $offset = false, $number = false ) { 105 105 global $bp; 106 106 107 107 $this->pag_page = $page; … … class BP_Forums_Template_Forum { 113 113 $this->number = $number; 114 114 115 115 switch ( $type ) { 116 case 'newest': default: 116 case 'newest': default: 117 117 $this->topics = bp_forums_get_forum_topics( array( 'user_id' => $user_id, 'forum_id' => $forum_id, 'filter' => $search_terms, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'show_stickies' => $no_stickies, 'offset' => $offset, 'number' => $number ) ); 118 118 break; 119 119 … … class BP_Forums_Template_Forum { 152 152 } else { 153 153 $this->total_topic_count = (int)$max; 154 154 } 155 155 156 156 if ( $max ) { 157 157 if ( $max >= count($this->topics) ) { 158 158 $this->topic_count = count( $this->topics ); … … function bp_has_forum_topics( $args = '' ) { 260 260 // User filtering 261 261 if ( !empty( $bp->displayed_user->id ) ) 262 262 $user_id = $bp->displayed_user->id; 263 263 264 264 // "Replied" query must be manually modified 265 265 if ( 'replies' == bp_current_action() ) { 266 266 $user_id = 0; // User id must be handled manually by the filter, not by BB_Query 267 267 268 268 add_filter( 'get_topics_distinct', 'bp_forums_add_replied_distinct_sql', 20 ); 269 269 add_filter( 'get_topics_join', 'bp_forums_add_replied_join_sql', 20 ); 270 270 add_filter( 'get_topics_where', 'bp_forums_add_replied_where_sql', 20 ); … … function bp_has_forum_topics( $args = '' ) { 285 285 // If $_GET['fs'] is set, let's auto populate the search_terms var 286 286 if ( bp_is_directory() && !empty( $_GET['fs'] ) ) 287 287 $search_terms = $_GET['fs']; 288 288 289 289 // Get the pagination arguments from $_REQUEST 290 290 $page = isset( $_REQUEST['p'] ) ? intval( $_REQUEST['p'] ) : 1; 291 291 $per_page = isset( $_REQUEST['n'] ) ? intval( $_REQUEST['n'] ) : 20; 292 292 293 293 // Unless set otherwise, stickies appear in normal order on the global forum directory 294 294 if ( bp_is_directory() && bp_is_forums_component() && !bp_forums_enable_global_directory_stickies() ) 295 295 $do_stickies = false; … … function bp_has_forum_topics( $args = '' ) { 315 315 if ( bp_is_current_action( 'tag' ) && $search_terms = bp_action_variable( 0 ) ) { 316 316 $type = 'tags'; 317 317 } 318 318 319 319 /** Sticky logic ******************************************************************/ 320 320 321 321 if ( $do_stickies ) { 322 322 // Fetch the stickies 323 323 $stickies_template = new BP_Forums_Template_Forum( $type, $forum_id, $user_id, 0, 0, $max, 'sticky', $search_terms ); 324 324 325 325 // If stickies are found, try merging them 326 326 if ( $stickies_template->has_topics() ) { 327 328 // If stickies are for current $page 327 328 // If stickies are for current $page 329 329 $page_start_num = ( ( $page - 1 ) * $per_page ) + 1; 330 330 $page_end_num = $page * $per_page <= $stickies_template->total_topic_count ? $page * $per_page : $stickies_template->total_topic_count; 331 331 332 332 // Calculate the number of sticky topics that will be shown on this page 333 333 if ( $stickies_template->topic_count < $page_start_num ) { 334 334 $this_page_stickies = 0; 335 } else { 335 } else { 336 336 $this_page_stickies = $stickies_template->topic_count - $per_page * floor( $stickies_template->topic_count / $per_page ) * ( $page - 1 ); // Total stickies minus sticky count through this page 337 337 338 338 // $this_page_stickies cannot be more than $per_page or less than 0 339 339 if ( $this_page_stickies > $per_page ) 340 340 $this_page_stickies = $per_page; 341 341 else if ( $this_page_stickies < 0 ) 342 342 $this_page_stickies = 0; 343 343 } 344 344 345 345 // Calculate the total number of topics that will be shown on this page 346 346 $this_page_topics = $stickies_template->total_topic_count >= ( $page * $per_page ) ? $per_page : $page_end_num - ( $page_start_num - 1 ); 347 347 348 348 // If the number of stickies to be shown is less than $per_page, fetch some 349 349 // non-stickies to fill in the rest 350 350 if ( $this_page_stickies < $this_page_topics ) { 351 351 // How many non-stickies do we need? 352 352 $non_sticky_number = $this_page_topics - $this_page_stickies; 353 354 // Calculate the non-sticky offset 353 354 // Calculate the non-sticky offset 355 355 // How many non-stickies on all pages up to this point? 356 356 $non_sticky_total = $page_end_num - $stickies_template->topic_count; 357 357 358 358 // The offset is the number of total non-stickies, less the number 359 359 // to be shown on this page 360 360 $non_sticky_offset = $non_sticky_total - $non_sticky_number; 361 361 362 362 // Fetch the non-stickies 363 363 $forum_template = new BP_Forums_Template_Forum( $type, $forum_id, $user_id, 1, $per_page, $max, 'no', $search_terms, $non_sticky_offset, $non_sticky_number ); 364 364 365 365 // If there are stickies to merge on this page, do it now 366 366 if ( $this_page_stickies ) { 367 367 // Correct the topic_count 368 368 $forum_template->topic_count += (int)$this_page_stickies; 369 369 370 370 // Figure out which stickies need to be included 371 371 $this_page_sticky_topics = array_slice( $stickies_template->topics, 0 - $this_page_stickies ); 372 372 373 373 // Merge these topics into the forum template 374 374 $forum_template->topics = array_merge( $this_page_sticky_topics, (array)$forum_template->topics ); 375 375 } 376 376 } else { 377 377 // This page has no non-stickies 378 378 $forum_template = $stickies_template; 379 379 380 380 // Adjust the topic count and trim the topics 381 381 $forum_template->topic_count = $this_page_stickies; 382 $forum_template->topics = array_slice( $forum_template->topics, $page - 1 ); 382 $forum_template->topics = array_slice( $forum_template->topics, $page - 1 ); 383 383 } 384 384 385 385 // Because we're using a manual offset and number for the topic query, we 386 386 // must set the page number manually, and recalculate the pagination links 387 387 $forum_template->pag_num = $per_page; 388 388 $forum_template->pag_page = $page; 389 389 390 390 $forum_template->pag_links = paginate_links( array( 391 391 'base' => add_query_arg( array( 'p' => '%#%', 'n' => $forum_template->pag_num ) ), 392 392 'format' => '', … … function bp_has_forum_topics( $args = '' ) { 396 396 'next_text' => '→', 397 397 'mid_size' => 1 398 398 ) ); 399 399 400 400 } else { 401 401 // Fetch the non-sticky topics if no stickies were found 402 402 $forum_template = new BP_Forums_Template_Forum( $type, $forum_id, $user_id, $page, $per_page, $max, 'all', $search_terms ); … … function bp_has_forum_topics( $args = '' ) { 405 405 // When skipping the sticky logic, just pull up the forum topics like usual 406 406 $forum_template = new BP_Forums_Template_Forum( $type, $forum_id, $user_id, $page, $per_page, $max, 'all', $search_terms ); 407 407 } 408 408 409 409 return apply_filters( 'bp_has_topics', $forum_template->has_topics(), $forum_template ); 410 410 } 411 411 … … function bp_forum_topic_type() { 864 864 */ 865 865 function bp_forums_tag_name() { 866 866 echo bp_get_forums_tag_name(); 867 } 867 } 868 868 /** 869 869 * Outputs the currently viewed tag name 870 870 * … … function bp_forums_tag_name() { 873 873 */ 874 874 function bp_get_forums_tag_name() { 875 875 $tag_name = bp_is_directory() && bp_is_forums_component() ? bp_action_variable( 0 ) : false; 876 876 877 877 return apply_filters( 'bp_get_forums_tag_name', $tag_name ); 878 878 } 879 879 … … class BP_Forums_Template_Topic { 939 939 function BP_Forums_Template_Topic( $topic_id, $per_page, $max, $order ) { 940 940 $this->__construct( $topic_id, $per_page, $max, $order ); 941 941 } 942 942 943 943 function __construct( $topic_id, $per_page, $max, $order ) { 944 944 global $bp, $current_user, $forum_template; 945 945 … … class BP_Forums_Template_Topic { 973 973 $this->post_count = count( $this->posts ); 974 974 } 975 975 } 976 976 977 977 // Load topic tags 978 978 $this->topic_tags = bb_get_topic_tags( $this->topic_id ); 979 979 … … function bp_has_forum_topic_posts( $args = '' ) { 1053 1053 $r = wp_parse_args( $args, $defaults ); 1054 1054 extract( $r, EXTR_SKIP ); 1055 1055 1056 if ( empty( $topic_id ) && bp_is_ current_component( 'groups') && bp_is_current_action( 'forum' ) && bp_is_action_variable( 'topic', 0 ) && bp_action_variable( 1 ) )1056 if ( empty( $topic_id ) && bp_is_groups_component() && bp_is_current_action( 'forum' ) && bp_is_action_variable( 'topic', 0 ) && bp_action_variable( 1 ) ) 1057 1057 $topic_id = bp_forums_get_topic_id_from_slug( bp_action_variable( 1 ) ); 1058 elseif ( empty( $topic_id ) && bp_is_ current_component( 'forums') && bp_is_current_action( 'topic' ) && bp_action_variable( 0 ) )1058 elseif ( empty( $topic_id ) && bp_is_forums_component() && bp_is_current_action( 'topic' ) && bp_action_variable( 0 ) ) 1059 1059 $topic_id = bp_forums_get_topic_id_from_slug( bp_action_variable( 0 ) ); 1060 1060 1061 1061 if ( empty( $topic_id ) ) { … … function bp_has_forum_topic_posts( $args = '' ) { 1068 1068 if ( bp_is_groups_component() && $topic_template->forum_id != groups_get_groupmeta( bp_get_current_group_id(), 'forum_id' ) ) 1069 1069 return false; 1070 1070 } 1071 1071 1072 1072 return apply_filters( 'bp_has_topic_posts', $topic_template->has_posts(), $topic_template ); 1073 1073 } 1074 1074 … … function bp_forum_topic_tag_list() { 1334 1334 */ 1335 1335 function bp_get_forum_topic_tag_list( $format = 'string' ) { 1336 1336 global $topic_template; 1337 1337 1338 1338 $tags_data = !empty( $topic_template->topic_tags ) ? $topic_template->topic_tags : false; 1339 1339 1340 1340 $tags = array(); 1341 1341 1342 1342 if ( $tags_data ) { 1343 1343 foreach( $tags_data as $tag_data ) { 1344 1344 $tags[] = $tag_data->name; 1345 1345 } 1346 1346 } 1347 1347 1348 1348 if ( 'string' == $format ) 1349 1349 $tags = implode( ', ', $tags ); 1350 1350 1351 1351 return apply_filters( 'bp_forum_topic_tag_list', $tags, $format ); 1352 1352 } 1353 1353 … … function bp_forum_topic_tag_list() { 1361 1361 */ 1362 1362 function bp_forum_topic_has_tags() { 1363 1363 global $topic_template; 1364 1364 1365 1365 $has_tags = false; 1366 1366 1367 1367 if ( !empty( $topic_template->topic_tags ) ) 1368 1368 $has_tags = true; 1369 1369 1370 1370 return apply_filters( 'bp_forum_topic_has_tags', $has_tags ); 1371 1371 } 1372 1372 -
bp-members/bp-members-screens.php
function bp_members_screen_display_profile() { 34 34 * @uses apply_filters() 35 35 */ 36 36 function bp_members_screen_index() { 37 if ( !bp_is_user() && bp_is_ current_component( 'members') ) {37 if ( !bp_is_user() && bp_is_members_component() ) { 38 38 bp_update_is_directory( true, 'members' ); 39 39 40 40 do_action( 'bp_members_screen_index' ); -
bp-messages/bp-messages-template.php
function bp_thread_has_messages( $args = '' ) { 722 722 $r = wp_parse_args( $args, $defaults ); 723 723 extract( $r, EXTR_SKIP ); 724 724 725 if ( !$thread_id && bp_is_ current_component( 'messages') && bp_is_current_action( 'view' ) )725 if ( !$thread_id && bp_is_messages_component() && bp_is_current_action( 'view' ) ) 726 726 $thread_id = (int)bp_action_variable( 0 ); 727 727 728 728 $thread_template = new BP_Messages_Thread_Template( $thread_id, $order ); -
bp-themes/bp-default/sidebar.php
56 56 <?php endif; ?> 57 57 58 58 <?php /* Show forum tags on the forums directory */ 59 if ( bp_is_active( 'forums' ) && bp_is_ current_component( 'forums') && bp_is_directory() ) : ?>59 if ( bp_is_active( 'forums' ) && bp_is_forums_component() && bp_is_directory() ) : ?> 60 60 <div id="forum-directory-tags" class="widget tags"> 61 61 <h3 class="widgettitle"><?php _e( 'Forum Topic Tags', 'buddypress' ) ?></h3> 62 62 <div id="tag-text"><?php bp_forums_tag_heat_map(); ?></div> -
bp-xprofile/bp-xprofile-actions.php
if ( !defined( 'ABSPATH' ) ) exit; 22 22 */ 23 23 function xprofile_action_delete_avatar() { 24 24 global $bp; 25 26 if ( !bp_is_ current_component( 'profile') || !bp_is_current_action( 'change-avatar' ) || !bp_is_action_variable( 'delete-avatar', 0 ) )25 26 if ( !bp_is_profile_component() || !bp_is_current_action( 'change-avatar' ) || !bp_is_action_variable( 'delete-avatar', 0 ) ) 27 27 return false; 28 28 29 29 // Check the nonce