Ticket #3465: 3465.001.diff
File 3465.001.diff, 2.8 KB (added by , 13 years ago) |
---|
-
bp-core/bp-core-template.php
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 … … 668 668 // Because slugs can differ from root_slugs, we should check them too 669 669 } elseif ( isset( $bp->{$component}->slug ) && $bp->{$component}->slug == $bp->current_component ) { 670 670 $is_current_component = true; 671 671 672 672 // Next, check to see whether $component is a canonical, 673 673 // non-translatable component name. If so, we can return its 674 674 // corresponding slug from $bp->active_components. … … 676 676 if ( strstr( $bp->current_component, $key ) ) 677 677 $is_current_component = true; 678 678 679 // If we haven't found a match yet, check against the root_slugs 679 // If we haven't found a match yet, check against the root_slugs 680 680 // created by $bp->pages, as well as the regular slugs 681 681 } else { 682 682 foreach ( $bp->active_components as $key => $id ) { … … 751 751 * @param int $position The array key you're testing against. If you don't provide a $position, 752 752 * the function will return true if the $action_variable is found *anywhere* in the action 753 753 * variables array. 754 * @return bool 754 * @return bool 755 755 */ 756 756 function bp_is_action_variable( $action_variable = '', $position = false ) { 757 757 $is_action_variable = false; 758 758 759 759 if ( false !== $position ) { 760 // When a $position is specified, check that slot in the action_variables array 760 // When a $position is specified, check that slot in the action_variables array 761 761 if ( $action_variable ) { 762 762 $is_action_variable = $action_variable == bp_action_variable( $position ); 763 763 } else { … … 769 769 // When no $position is specified, check the entire array 770 770 $is_action_variable = in_array( $action_variable, (array)bp_action_variables() ); 771 771 } 772 772 773 773 return apply_filters( 'bp_is_action_variable', $is_action_variable, $action_variable, $position ); 774 774 } 775 775 … … 828 828 */ 829 829 function bp_is_root_component( $component_name ) { 830 830 global $bp; 831 831 832 832 if ( !isset( $bp->active_components ) ) 833 833 return false; 834 834 … … 1029 1029 1030 1030 if ( bp_is_current_component( 'xprofile' ) && bp_is_current_action( 'edit' ) ) 1031 1031 return true; 1032 1032 1033 1033 return false; 1034 1034 } 1035 1035 … … 1289 1289 /** Registration **************************************************************/ 1290 1290 1291 1291 function bp_is_activation_page() { 1292 if ( bp_is_current_component( 'activat ion' ) )1292 if ( bp_is_current_component( 'activate' ) ) 1293 1293 return true; 1294 1294 1295 1295 return false;