Ticket #3399: 3399.02.patch
File 3399.02.patch, 12.5 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_user_activity() || !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_user_activity() || !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_user_activity() || !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_user_activity() || !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_user_activity() || !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_is_settings_component() { 1064 1064 function bp_is_single_activity() { 1065 1065 global $bp; 1066 1066 1067 if ( bp_is_ current_component( 'activity') && is_numeric( $bp->current_action ) )1067 if ( bp_is_activity_component() && is_numeric( $bp->current_action ) ) 1068 1068 return true; 1069 1069 1070 1070 return false; … … function bp_is_user() { 1095 1095 function bp_is_user_activity() { 1096 1096 global $bp; 1097 1097 1098 if ( bp_is_ current_component( 'activity') )1098 if ( bp_is_activity_component() && bp_is_user() ) 1099 1099 return true; 1100 1100 1101 1101 return false; … … function bp_is_user_activity() { 1104 1104 function bp_is_user_friends_activity() { 1105 1105 global $bp; 1106 1106 1107 if ( bp_is_ current_component( 'activity') && bp_is_current_action( 'my-friends' ) )1107 if ( bp_is_activity_component() && bp_is_current_action( 'my-friends' ) ) 1108 1108 return true; 1109 1109 1110 1110 return false; … … function bp_is_user_friends_activity() { 1113 1113 function bp_is_user_profile() { 1114 1114 global $bp; 1115 1115 1116 if ( bp_is_ current_component( 'xprofile') || bp_is_current_component( 'profile' ) )1116 if ( bp_is_profile_component() || bp_is_current_component( 'profile' ) ) 1117 1117 return true; 1118 1118 1119 1119 return false; … … function bp_is_user_profile() { 1122 1122 function bp_is_user_profile_edit() { 1123 1123 global $bp; 1124 1124 1125 if ( bp_is_ current_component( 'xprofile') && bp_is_current_action( 'edit' ) )1125 if ( bp_is_profile_component() && bp_is_current_action( 'edit' ) ) 1126 1126 return true; 1127 1127 1128 1128 return false; … … function bp_is_user_profile_edit() { 1131 1131 function bp_is_user_change_avatar() { 1132 1132 global $bp; 1133 1133 1134 if ( bp_is_ current_component( 'xprofile') && bp_is_current_action( 'change-avatar' ) )1134 if ( bp_is_profile_component() && bp_is_current_action( 'change-avatar' ) ) 1135 1135 return true; 1136 1136 1137 1137 return false; … … function bp_is_user_change_avatar() { 1145 1145 * @return bool 1146 1146 */ 1147 1147 function bp_is_user_forums() { 1148 if ( bp_is_ current_component( 'forums') )1148 if ( bp_is_forums_component() && bp_is_user() ) 1149 1149 return true; 1150 1150 1151 1151 return false; … … function bp_is_user_forums() { 1160 1160 * @return bool 1161 1161 */ 1162 1162 function bp_is_user_forums_started() { 1163 if ( bp_is_ current_component( 'forums') && bp_is_current_action( 'topics' ) )1163 if ( bp_is_forums_component() && bp_is_current_action( 'topics' ) ) 1164 1164 return true; 1165 1165 1166 1166 return false; … … function bp_is_user_forums_started() { 1175 1175 * @return bool 1176 1176 */ 1177 1177 function bp_is_user_forums_replied_to() { 1178 if ( bp_is_ current_component( 'forums') && bp_is_current_action( 'replies' ) )1178 if ( bp_is_forums_component() && bp_is_current_action( 'replies' ) ) 1179 1179 return true; 1180 1180 1181 1181 return false; … … function bp_is_user_forums_replied_to() { 1184 1184 function bp_is_user_groups() { 1185 1185 global $bp; 1186 1186 1187 if ( bp_is_ current_component( 'groups') )1187 if ( bp_is_groups_component() && bp_is_user() ) 1188 1188 return true; 1189 1189 1190 1190 return false; … … function bp_is_user_groups() { 1193 1193 function bp_is_user_blogs() { 1194 1194 global $bp; 1195 1195 1196 if ( is_multisite() && bp_is_current_component( 'blogs') )1196 if ( bp_is_blogs_component() && bp_is_user() ) 1197 1197 return true; 1198 1198 1199 1199 return false; … … function bp_is_user_blogs() { 1202 1202 function bp_is_user_recent_posts() { 1203 1203 global $bp; 1204 1204 1205 if ( is_multisite() && bp_is_current_component( 'blogs') && bp_is_current_action( 'recent-posts' ) )1205 if ( bp_is_blogs_component() && bp_is_current_action( 'recent-posts' ) ) 1206 1206 return true; 1207 1207 1208 1208 return false; … … function bp_is_user_recent_posts() { 1211 1211 function bp_is_user_recent_commments() { 1212 1212 global $bp; 1213 1213 1214 if ( is_multisite() && bp_is_current_component( 'blogs') && bp_is_current_action( 'recent-comments' ) )1214 if ( bp_is_blogs_component() && bp_is_current_action( 'recent-comments' ) ) 1215 1215 return true; 1216 1216 1217 1217 return false; … … function bp_is_user_recent_commments() { 1219 1219 1220 1220 function bp_is_user_friends() { 1221 1221 1222 if ( bp_is_ current_component( 'friends') )1222 if ( bp_is_friends_component() && bp_is_user() ) 1223 1223 return true; 1224 1224 1225 1225 return false; … … function bp_is_user_friends() { 1228 1228 function bp_is_user_friend_requests() { 1229 1229 global $bp; 1230 1230 1231 if ( bp_is_ current_component( 'friends') && bp_is_current_action( 'requests' ) )1231 if ( bp_is_friends_component() && bp_is_current_action( 'requests' ) ) 1232 1232 return true; 1233 1233 1234 1234 return false; … … function bp_is_group_single() { 1354 1354 function bp_is_create_blog() { 1355 1355 global $bp; 1356 1356 1357 if ( is_multisite() && bp_is_current_component( 'blogs') && bp_is_current_action( 'create' ) )1357 if ( bp_is_blogs_component() && bp_is_current_action( 'create' ) ) 1358 1358 return true; 1359 1359 1360 1360 return false; … … function bp_is_create_blog() { 1364 1364 1365 1365 function bp_is_user_messages() { 1366 1366 1367 if ( bp_is_ current_component( 'messages') )1367 if ( bp_is_messages_component() && bp_is_user() ) 1368 1368 return true; 1369 1369 1370 1370 return false; … … function bp_is_user_messages() { 1373 1373 function bp_is_messages_inbox() { 1374 1374 global $bp; 1375 1375 1376 if ( bp_is_ current_component( 'messages') && ( !bp_current_action() || bp_is_current_action( 'inbox' ) ) )1376 if ( bp_is_messages_component() && ( !bp_current_action() || bp_is_current_action( 'inbox' ) ) ) 1377 1377 return true; 1378 1378 1379 1379 return false; … … function bp_is_messages_inbox() { 1382 1382 function bp_is_messages_sentbox() { 1383 1383 global $bp; 1384 1384 1385 if ( bp_is_ current_component( 'messages') && bp_is_current_action( 'sentbox' ) )1385 if ( bp_is_messages_component() && bp_is_current_action( 'sentbox' ) ) 1386 1386 return true; 1387 1387 1388 1388 return false; … … function bp_is_messages_sentbox() { 1391 1391 function bp_is_messages_compose_screen() { 1392 1392 global $bp; 1393 1393 1394 if ( bp_is_ current_component( 'messages') && bp_is_current_action( 'compose' ) )1394 if ( bp_is_messages_component() && bp_is_current_action( 'compose' ) ) 1395 1395 return true; 1396 1396 1397 1397 return false; … … function bp_is_messages_compose_screen() { 1400 1400 function bp_is_notices() { 1401 1401 global $bp; 1402 1402 1403 if ( bp_is_ current_component( 'messages') && bp_is_current_action( 'notices' ) )1403 if ( bp_is_messages_component() && bp_is_current_action( 'notices' ) ) 1404 1404 return true; 1405 1405 1406 1406 return false; -
bp-forums/bp-forums-template.php
function bp_has_forum_topic_posts( $args = '' ) { 1056 1056 $r = wp_parse_args( $args, $defaults ); 1057 1057 extract( $r, EXTR_SKIP ); 1058 1058 1059 if ( empty( $topic_id ) && bp_is_ current_component( 'groups') && bp_is_current_action( 'forum' ) && bp_is_action_variable( 'topic', 0 ) && bp_action_variable( 1 ) )1059 if ( empty( $topic_id ) && bp_is_groups_component() && bp_is_current_action( 'forum' ) && bp_is_action_variable( 'topic', 0 ) && bp_action_variable( 1 ) ) 1060 1060 $topic_id = bp_forums_get_topic_id_from_slug( bp_action_variable( 1 ) ); 1061 elseif ( empty( $topic_id ) && bp_is_ current_component( 'forums') && bp_is_current_action( 'topic' ) && bp_action_variable( 0 ) )1061 elseif ( empty( $topic_id ) && bp_is_forums_component() && bp_is_current_action( 'topic' ) && bp_action_variable( 0 ) ) 1062 1062 $topic_id = bp_forums_get_topic_id_from_slug( bp_action_variable( 0 ) ); 1063 1063 1064 1064 if ( empty( $topic_id ) ) { -
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
59 59 <?php endif; ?> 60 60 61 61 <?php /* Show forum tags on the forums directory */ 62 if ( bp_is_active( 'forums' ) && bp_is_ current_component( 'forums') && bp_is_directory() ) : ?>62 if ( bp_is_active( 'forums' ) && bp_is_forums_component() && bp_is_directory() ) : ?> 63 63 <div id="forum-directory-tags" class="widget tags"> 64 64 <h3 class="widgettitle"><?php _e( 'Forum Topic Tags', 'buddypress' ) ?></h3> 65 65 <div id="tag-text"><?php bp_forums_tag_heat_map(); ?></div> -
bp-xprofile/bp-xprofile-actions.php
if ( !defined( 'ABSPATH' ) ) exit; 23 23 function xprofile_action_delete_avatar() { 24 24 global $bp; 25 25 26 if ( !bp_is_ current_component( 'profile' ) || !bp_is_current_action( 'change-avatar') || !bp_is_action_variable( 'delete-avatar', 0 ) )26 if ( !bp_is_user_change_avatar() || !bp_is_action_variable( 'delete-avatar', 0 ) ) 27 27 return false; 28 28 29 29 // Check the nonce