Ticket #3398: 3398.01.patch
| File 3398.01.patch, 3.4 KB (added by , 15 years ago) |
|---|
-
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_profile_component() { 912 912 } 913 913 914 914 function bp_is_activity_component() { 915 if ( bp_is_current_component( 'activity' ) )915 if ( bp_is_current_component( 'activity' ) || bp_is_current_component( bp_get_activity_slug() ) ) 916 916 return true; 917 917 918 918 return false; … … 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() ) 1001 1001 return true; 1002 1002 1003 1003 return false; … … function bp_is_user_profile_edit() { 1026 1026 1027 1027 if ( bp_is_current_component( 'xprofile' ) && bp_is_current_action( 'edit' ) ) 1028 1028 return true; 1029 1029 1030 1030 return false; 1031 1031 } 1032 1032 -
bp-members/bp-members-loader.php
class BP_Members_Component extends BP_Component { 109 109 /** Default Profile Component *****************************************/ 110 110 if ( !defined( 'BP_DEFAULT_COMPONENT' ) ) { 111 111 if ( bp_is_active( 'activity' ) && isset( $bp->pages->activity ) ) 112 $bp->default_component = $bp->activity->id;112 $bp->default_component = bp_get_activity_slug(); 113 113 else 114 114 $bp->default_component = ( 'xprofile' == $bp->profile->id ) ? 'profile' : $bp->profile->id; 115 115