diff --git bp-activity/bp-activity-loader.php bp-activity/bp-activity-loader.php
index 651401e..cc54e7b 100644
|
|
class BP_Activity_Component extends BP_Component { |
106 | 106 | 'slug' => BP_ACTIVITY_SLUG, |
107 | 107 | 'root_slug' => isset( $bp->pages->activity->slug ) ? $bp->pages->activity->slug : BP_ACTIVITY_SLUG, |
108 | 108 | 'has_directory' => true, |
| 109 | 'directory_title' => _x( 'Sitewide Activity', 'component directory title', 'buddypress' ), |
109 | 110 | 'notification_callback' => 'bp_activity_format_notifications', |
110 | 111 | 'search_string' => __( 'Search Activity...', 'buddypress' ), |
111 | 112 | 'global_tables' => $global_tables, |
diff --git bp-activity/bp-activity-screens.php bp-activity/bp-activity-screens.php
index cd0b679..2406771 100644
|
|
class BP_Activity_Theme_Compat { |
381 | 381 | public function directory_dummy_post() { |
382 | 382 | bp_theme_compat_reset_post( array( |
383 | 383 | 'ID' => 0, |
384 | | 'post_title' => __( 'Sitewide Activity', 'buddypress' ), |
| 384 | 'post_title' => bp_get_directory_title( 'activity' ), |
385 | 385 | 'post_author' => 0, |
386 | 386 | 'post_date' => 0, |
387 | 387 | 'post_content' => '', |
diff --git bp-core/bp-core-component.php bp-core/bp-core-component.php
index d5fab57..c16c17c 100644
|
|
class BP_Component { |
215 | 215 | 'slug' => $this->id, |
216 | 216 | 'root_slug' => $default_root_slug, |
217 | 217 | 'has_directory' => false, |
| 218 | 'directory_title' => '', |
218 | 219 | 'notification_callback' => '', |
219 | 220 | 'search_string' => '', |
220 | 221 | 'global_tables' => '', |
… |
… |
class BP_Component { |
230 | 231 | // Does this component have a top-level directory? |
231 | 232 | $this->has_directory = apply_filters( 'bp_' . $this->id . '_has_directory', $r['has_directory'] ); |
232 | 233 | |
| 234 | // Does this component have a top-level directory? |
| 235 | $this->directory_title = apply_filters( 'bp_' . $this->id . '_directory_title', $r['directory_title'] ); |
| 236 | |
233 | 237 | // Search string |
234 | 238 | $this->search_string = apply_filters( 'bp_' . $this->id . '_search_string', $r['search_string'] ); |
235 | 239 | |
diff --git bp-core/bp-core-filters.php bp-core/bp-core-filters.php
index 9c4dfbe..aecf786 100644
|
|
function bp_modify_page_title( $title, $sep, $seplocation ) { |
431 | 431 | |
432 | 432 | // An index or directory |
433 | 433 | } elseif ( bp_is_directory() ) { |
434 | | if ( !bp_current_component() ) { |
435 | | $title = sprintf( __( '%s Directory', 'buddypress' ), bp_get_name_from_root_slug() ); |
| 434 | |
| 435 | $current_component = bp_current_component(); |
| 436 | |
| 437 | // No current component (when does this happen?) |
| 438 | if ( empty( $current_component ) ) { |
| 439 | $title = __( 'Directory', 'buddypress' ); |
436 | 440 | } else { |
437 | | $title = sprintf( __( '%s Directory', 'buddypress' ), bp_get_name_from_root_slug() ); |
| 441 | $title = bp_get_directory_title( $current_component ); |
438 | 442 | } |
439 | 443 | |
440 | 444 | // Sign up page |
diff --git bp-core/bp-core-template.php bp-core/bp-core-template.php
index 8d0b50c..84a2608 100644
|
|
function bp_get_options_title() { |
83 | 83 | echo apply_filters( 'bp_get_options_title', esc_attr( $bp->bp_options_title ) ); |
84 | 84 | } |
85 | 85 | |
| 86 | /** |
| 87 | * Get the directory title for a component. |
| 88 | * |
| 89 | * Used for the <title> element and the page header on the component directory |
| 90 | * page. |
| 91 | * |
| 92 | * @since BuddyPress (2.0.0) |
| 93 | * |
| 94 | * @return string |
| 95 | */ |
| 96 | function bp_get_directory_title( $component = '' ) { |
| 97 | $title = ''; |
| 98 | |
| 99 | // Use the string provided by the component |
| 100 | if ( isset( buddypress()->{$component}->directory_title ) ) { |
| 101 | $title = buddypress()->{$component}->directory_title; |
| 102 | |
| 103 | // If none is found, concatenate |
| 104 | } else if ( isset( buddypress()->{$component}->name ) ) { |
| 105 | $title = sprintf( __( '%s Directory', 'buddypress' ), buddypress()->{$component}->name ); |
| 106 | } |
| 107 | |
| 108 | return apply_filters( 'bp_get_directory_title', $title, $component ); |
| 109 | } |
| 110 | |
86 | 111 | /** Avatars *******************************************************************/ |
87 | 112 | |
88 | 113 | /** |
diff --git bp-groups/bp-groups-loader.php bp-groups/bp-groups-loader.php
index b40bf45..ec53658 100644
|
|
class BP_Groups_Component extends BP_Component { |
147 | 147 | 'slug' => BP_GROUPS_SLUG, |
148 | 148 | 'root_slug' => isset( $bp->pages->groups->slug ) ? $bp->pages->groups->slug : BP_GROUPS_SLUG, |
149 | 149 | 'has_directory' => true, |
| 150 | 'directory_title' => _x( 'Groups', 'component directory title', 'buddypress' ), |
150 | 151 | 'notification_callback' => 'groups_format_notifications', |
151 | 152 | 'search_string' => __( 'Search Groups...', 'buddypress' ), |
152 | 153 | 'global_tables' => $global_tables, |
diff --git bp-groups/bp-groups-screens.php bp-groups/bp-groups-screens.php
index f461e6f..ced55a2 100644
|
|
class BP_Groups_Theme_Compat { |
1021 | 1021 | */ |
1022 | 1022 | public function directory_dummy_post() { |
1023 | 1023 | |
1024 | | $title = apply_filters( 'bp_groups_directory_title', __( 'Groups', 'buddypress' ) ); |
| 1024 | $title = apply_filters( 'bp_groups_directory_title', bp_get_directory_title( 'groups' ) ); |
1025 | 1025 | |
1026 | 1026 | bp_theme_compat_reset_post( array( |
1027 | 1027 | 'ID' => 0, |
diff --git bp-members/bp-members-loader.php bp-members/bp-members-loader.php
index d88380b..1402195 100644
|
|
class BP_Members_Component extends BP_Component { |
72 | 72 | 'slug' => BP_MEMBERS_SLUG, |
73 | 73 | 'root_slug' => isset( $bp->pages->members->slug ) ? $bp->pages->members->slug : BP_MEMBERS_SLUG, |
74 | 74 | 'has_directory' => true, |
| 75 | 'directory_title' => _x( 'Members', 'component directory title', 'buddypress' ), |
75 | 76 | 'global_tables' => array( |
76 | 77 | 'table_name_last_activity' => bp_core_get_table_prefix() . 'bp_activity', |
77 | 78 | ), |
diff --git bp-members/bp-members-screens.php bp-members/bp-members-screens.php
index 4cb9f40..d652985 100644
|
|
class BP_Members_Theme_Compat { |
363 | 363 | public function directory_dummy_post() { |
364 | 364 | bp_theme_compat_reset_post( array( |
365 | 365 | 'ID' => 0, |
366 | | 'post_title' => __( 'Members', 'buddypress' ), |
| 366 | 'post_title' => bp_get_directory_title( 'members' ), |
367 | 367 | 'post_author' => 0, |
368 | 368 | 'post_date' => 0, |
369 | 369 | 'post_content' => '', |