Changeset 3730
- Timestamp:
- 01/18/2011 06:03:57 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-templatetags.php
r3728 r3730 455 455 global $bp; 456 456 457 $default_search_value = bp_get_search_default_text(); 457 $default_search_value = bp_get_search_default_text(); 458 458 $search_value = !empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : $default_search_value; 459 459 … … 534 534 535 535 /** 536 * bp_get_displayed_user_nav() 537 * TEMPLATE TAG 538 * 539 * Uses the $bp->bp_users_nav global to render out the user navigation when viewing another user other than 536 * Uses the $bp->bp_nav global to render out the user navigation when viewing another user other than 540 537 * yourself. 541 538 * … … 583 580 function bp_get_options_nav() { 584 581 global $bp; 585 582 586 583 // If we are looking at a member profile, then the we can use the current component as an 587 584 // index. Otherwise we need to use the component's root_slug 588 585 $component_index = !empty( $bp->displayed_user ) ? $bp->current_component : bp_get_root_slug( $bp->current_component ); 589 586 590 587 if ( count( $bp->bp_options_nav[$component_index] ) < 1 ) 591 588 return false; … … 1053 1050 } 1054 1051 1055 /** 1056 * Get the default text for the search box for a given component. 1057 * 1058 * @global object $bp BuddyPress global settings 1059 * @return string 1060 * @since 1.3 1061 */ 1062 function bp_search_default_text() { 1063 echo bp_get_search_default_text(); 1064 } 1065 function bp_get_search_default_text( $component = false ) { 1066 global $bp; 1067 1068 if ( empty( $component ) ) 1052 /** 1053 * Get the default text for the search box for a given component. 1054 * 1055 * @global object $bp BuddyPress global settings 1056 * @return string 1057 * @since 1.3 1058 */ 1059 function bp_search_default_text() { 1060 echo bp_get_search_default_text(); 1061 } 1062 function bp_get_search_default_text( $component = false ) { 1063 global $bp; 1064 1065 if ( empty( $component ) ) 1069 1066 $component = $bp->current_component; 1070 1067 1071 1068 $default_text = __( 'Search anything...', 'buddypress' ); 1072 1069 1073 1070 if ( !empty( $bp->default_search_strings[$component] ) ) { 1074 1071 // Most of the time, $component will be the actual component name … … 1083 1080 } 1084 1081 } 1085 1086 return apply_filters( 'bp_search_default_text', $default_text, $component ); 1087 } 1082 1083 return apply_filters( 'bp_search_default_text', $default_text, $component ); 1084 } 1088 1085 1089 1086 function bp_search_form() { … … 1121 1118 /** 1122 1119 * Creates and outputs a button. 1123 * 1120 * 1124 1121 * @param array $args See bp_get_button() for the list of arguments. 1125 1122 * @see bp_get_button() … … 1174 1171 1175 1172 preg_match( "%\s*((?:<[^>]+>)+\S*)\s*|\s+%s", $text, $matches, PREG_OFFSET_CAPTURE, $excerpt_length ); 1176 1173 1177 1174 if ( !empty( $matches ) ) { 1178 $pos = array_pop( array_pop( $matches ) ); 1175 $pos = array_pop( array_pop( $matches ) ); 1179 1176 $text = substr( $text, 0, $pos ) . ' [...]'; 1180 1177 } 1181 1178 1182 1179 return apply_filters( 'bp_create_excerpt', $text, $original_text ); 1183 1180 } … … 1606 1603 1607 1604 // Component has specific root slug 1608 if ( !empty( $bp->{$component_name}->root_slug ) ) 1605 if ( !empty( $bp->{$component_name}->root_slug ) ) 1609 1606 $root_slug = $bp->{$component_name}->root_slug; 1610 1607 } … … 1904 1901 function bp_is_user_groups() { 1905 1902 global $bp; 1906 1903 1907 1904 if ( bp_is_current_component( BP_GROUPS_SLUG ) ) 1908 1905 return true; … … 1913 1910 function bp_is_group() { 1914 1911 global $bp; 1915 1912 1916 1913 if ( bp_is_current_component( BP_GROUPS_SLUG ) && isset( $bp->groups->current_group ) && $bp->groups->current_group ) 1917 1914 return true;
Note: See TracChangeset
for help on using the changeset viewer.