diff --git src/bp-core/classes/class-bp-component.php src/bp-core/classes/class-bp-component.php
index 8a53680..b5e2cfb 100644
|
|
|
class BP_Component { |
| 226 | 226 | * } |
| 227 | 227 | */ |
| 228 | 228 | public function setup_globals( $args = array() ) { |
| | 229 | $bp = buddypress(); |
| 229 | 230 | |
| 230 | 231 | /** Slugs ************************************************************ |
| 231 | 232 | */ |
| 232 | 233 | |
| 233 | 234 | // If a WP directory page exists for the component, it should |
| 234 | 235 | // be the default value of 'root_slug'. |
| 235 | | $default_root_slug = isset( buddypress()->pages->{$this->id}->slug ) ? buddypress()->pages->{$this->id}->slug : ''; |
| | 236 | $default_root_slug = isset( $bp->pages->{$this->id}->slug ) ? $bp->pages->{$this->id}->slug : ''; |
| 236 | 237 | |
| 237 | 238 | $r = wp_parse_args( $args, array( |
| 238 | 239 | 'slug' => $this->id, |
| … |
… |
class BP_Component { |
| 273 | 274 | $this->has_directory = apply_filters( 'bp_' . $this->id . '_has_directory', $r['has_directory'] ); |
| 274 | 275 | |
| 275 | 276 | /** |
| | 277 | * Use the WordPress Page title as the directory page title if it exists. |
| | 278 | */ |
| | 279 | if ( $this->has_directory && ! empty( $bp->pages->{$this->id}->title ) ) { |
| | 280 | $r['directory_title'] = $bp->pages->{$this->id}->title; |
| | 281 | } |
| | 282 | |
| | 283 | /** |
| 276 | 284 | * Filters the component's directory title. |
| 277 | 285 | * |
| 278 | 286 | * @since 2.0.0 |