Changeset 13436 for trunk/src/bp-blogs/classes/class-bp-blogs-component.php
- Timestamp:
- 03/15/2023 08:16:46 AM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-blogs/classes/class-bp-blogs-component.php
r13432 r13436 82 82 'has_directory' => is_multisite(), // Non-multisite installs don't need a top-level Sites directory, since there's only one site. 83 83 'rewrite_ids' => array( 84 'directory' => 'blogs', 85 'single_item_action' => 'blogs_action', 86 'single_item_action_variables' => 'blogs_action_variables', 84 'directory' => 'blogs', 85 'create_single_item' => 'blog_create', 87 86 ), 88 87 'directory_title' => isset( $bp->pages->blogs->title ) ? $bp->pages->blogs->title : $default_directory_title, … … 312 311 // Create a Site. 313 312 if ( bp_blog_signup_enabled() ) { 313 $url = bp_get_blogs_directory_url( 314 array( 315 'create_single_item' => 1, 316 ) 317 ); 318 314 319 $wp_admin_nav[] = array( 315 320 'parent' => 'my-account-' . $this->id, 316 321 'id' => 'my-account-' . $this->id . '-create', 317 322 'title' => __( 'Create a Site', 'buddypress' ), 318 'href' => trailingslashit( bp_get_blogs_directory_permalink() . 'create' ),323 'href' => $url, 319 324 'position' => 99 320 325 ); … … 371 376 372 377 parent::setup_cache_groups(); 378 } 379 380 /** 381 * Add the Blog Create rewrite tags. 382 * 383 * @since 12.0.0 384 * 385 * @param array $rewrite_tags Optional. See BP_Component::add_rewrite_tags() for 386 * description. 387 */ 388 public function add_rewrite_tags( $rewrite_tags = array() ) { 389 $rewrite_tags = array( 390 'create_single_item' => '([1]{1,})', 391 ); 392 393 parent::add_rewrite_tags( $rewrite_tags ); 394 } 395 396 /** 397 * Add the Registration and Activation rewrite rules. 398 * 399 * @since 12.0.0 400 * 401 * @param array $rewrite_rules Optional. See BP_Component::add_rewrite_rules() for 402 * description. 403 */ 404 public function add_rewrite_rules( $rewrite_rules = array() ) { 405 $create_slug = bp_rewrites_get_slug( 'blogs', 'blog_create', 'create' ); 406 407 $rewrite_rules = array( 408 'create_single_item' => array( 409 'regex' => $this->root_slug . '/' . $create_slug . '/?$', 410 'order' => 50, 411 'query' => 'index.php?' . $this->rewrite_ids['directory'] . '=1&' . $this->rewrite_ids['create_single_item'] . '=1', 412 ), 413 ); 414 415 parent::add_rewrite_rules( $rewrite_rules ); 373 416 } 374 417
Note: See TracChangeset
for help on using the changeset viewer.