Changeset 9641 for trunk/src/bp-core/bp-core-component.php
- Timestamp:
- 03/24/2015 06:19:49 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-component.php
r9351 r9641 223 223 ) ); 224 224 225 // Slug used for permalink URI chunk after root 225 /** 226 * Filters the slug to be used for the permalink URI chunk after root. 227 * 228 * @since BuddyPress (1.5.0) 229 * 230 * @param string $value Slug to use in permalink URI chunk. 231 */ 226 232 $this->slug = apply_filters( 'bp_' . $this->id . '_slug', $r['slug'] ); 227 233 228 // Slug used for root directory 234 /** 235 * Filters the slug used for root directory. 236 * 237 * @since BuddyPress (1.5.0) 238 * 239 * @param string $value Root directory slug. 240 */ 229 241 $this->root_slug = apply_filters( 'bp_' . $this->id . '_root_slug', $r['root_slug'] ); 230 242 231 // Does this component have a top-level directory? 243 /** 244 * Filters the component's top-level directory if available. 245 * 246 * @since BuddyPress (1.5.0) 247 * 248 * @param bool $value Whether or not there is a top-level directory. 249 */ 232 250 $this->has_directory = apply_filters( 'bp_' . $this->id . '_has_directory', $r['has_directory'] ); 233 251 234 // Does this component have a top-level directory? 252 /** 253 * Filters the component's directory title. 254 * 255 * @since BuddyPress (2.0.0) 256 * 257 * @param string $value Title to use for the directory. 258 */ 235 259 $this->directory_title = apply_filters( 'bp_' . $this->id . '_directory_title', $r['directory_title'] ); 236 260 237 // Search string 261 /** 262 * Filters the placeholder text for search inputs for component. 263 * 264 * @since BuddyPress (1.5.0) 265 * 266 * @param string $value Name to use in search input placeholders. 267 */ 238 268 $this->search_string = apply_filters( 'bp_' . $this->id . '_search_string', $r['search_string'] ); 239 269 240 // Notifications callback 270 /** 271 * Filters the callable function that formats the component's notifications. 272 * 273 * @since BuddyPress (1.5.0) 274 * 275 * @param string $value Function callback. 276 */ 241 277 $this->notification_callback = apply_filters( 'bp_' . $this->id . '_notification_callback', $r['notification_callback'] ); 242 278 … … 256 292 buddypress()->loaded_components[$this->slug] = $this->id; 257 293 258 // Call action 294 /** 295 * Fires at the end of the setup_globals method inside BP_Component. 296 * 297 * This is a dynamic hook that is based on the component string ID. 298 * 299 * @since BuddyPress (1.5.0) 300 */ 259 301 do_action( 'bp_' . $this->id . '_setup_globals' ); 260 302 } … … 321 363 } 322 364 323 // Call action 365 /** 366 * Fires at the end of the includes method inside BP_Component. 367 * 368 * This is a dynamic hook that is based on the component string ID. 369 * 370 * @since BuddyPress (1.5.0) 371 */ 324 372 do_action( 'bp_' . $this->id . '_includes' ); 325 373 } … … 381 429 add_action( 'bp_generate_rewrite_rules', array( $this, 'generate_rewrite_rules' ), 10 ); 382 430 383 // Additional actions can be attached here 431 /** 432 * Fires at the end of the setup_actions method inside BP_Component. 433 * 434 * This is a dynamic hook that is based on the component string ID. 435 * 436 * @since BuddyPress (1.5.0) 437 */ 384 438 do_action( 'bp_' . $this->id . '_setup_actions' ); 385 439 } … … 420 474 } 421 475 422 // Call action 476 /** 477 * Fires at the end of the setup_nav method inside BP_Component. 478 * 479 * This is a dynamic hook that is based on the component string ID. 480 * 481 * @since BuddyPress (1.5.0) 482 */ 423 483 do_action( 'bp_' . $this->id . '_setup_nav' ); 424 484 } … … 448 508 } 449 509 450 // Filter the passed admin nav 510 /** 511 * Filters the admin navigation passed into setup_admin_bar. 512 * 513 * This is a dynamic hook that is based on the component string ID. 514 * 515 * @since BuddyPress (1.9.0) 516 * 517 * @param array $wp_admin_nav Array of navigation items to add. 518 */ 451 519 $wp_admin_nav = apply_filters( 'bp_' . $this->id . '_admin_nav', $wp_admin_nav ); 452 520 … … 466 534 } 467 535 468 // Call action 536 /** 537 * Fires at the end of the setup_admin_bar method inside BP_Component. 538 * 539 * This is a dynamic hook that is based on the component string ID. 540 * 541 * @since BuddyPress (1.5.0) 542 */ 469 543 do_action( 'bp_' . $this->id . '_setup_admin_bar' ); 470 544 } … … 478 552 */ 479 553 public function setup_title() { 554 555 /** 556 * Fires in the setup_title method inside BP_Component. 557 * 558 * This is a dynamic hook that is based on the component string ID. 559 * 560 * @since BuddyPress (1.5.0) 561 */ 480 562 do_action( 'bp_' . $this->id . '_setup_title' ); 481 563 } … … 489 571 */ 490 572 public function setup_cache_groups() { 573 574 /** 575 * Fires in the setup_cache_groups method inside BP_Component. 576 * 577 * This is a dynamic hook that is based on the component string ID. 578 * 579 * @since BuddyPress (2.2.0) 580 */ 491 581 do_action( 'bp_' . $this->id . '_setup_cache_groups' ); 492 582 } … … 501 591 public function register_global_tables( $tables = array() ) { 502 592 503 // This filter allows for component-specific filtering of table names 504 // To filter *all* tables, use the 'bp_core_get_table_prefix' filter instead 593 /** 594 * Filters the global tables for the component, so that it may use WordPress' database API. 595 * 596 * This is a dynamic hook that is based on the component string ID. 597 * It allows for component-specific filtering of table names. To filter 598 * *all* tables, use the 'bp_core_get_table_prefix' filter instead. 599 * 600 * @since BuddyPress (1.6.0) 601 */ 505 602 $tables = apply_filters( 'bp_' . $this->id . '_global_tables', $tables ); 506 603 … … 515 612 } 516 613 614 /** 615 * Fires at the end of the register_global_tables method inside BP_Component. 616 * 617 * This is a dynamic hook that is based on the component string ID. 618 * 619 * @since BuddyPress (2.0.0) 620 */ 517 621 do_action( 'bp_' . $this->id . '_register_global_tables' ); 518 622 } … … 531 635 global $wpdb; 532 636 533 // This filter allows for component-specific filtering of table names 534 // To filter *all* tables, use the 'bp_core_get_table_prefix' filter instead 637 /** 638 * Filters the global meta_tables for the component. 639 * 640 * This is a dynamic hook that is based on the component string ID. 641 * It allows for component-specific filtering of table names. To filter 642 * *all* tables, use the 'bp_core_get_table_prefix' filter instead. 643 * 644 * @since BuddyPress (2.0.0) 645 */ 535 646 $tables = apply_filters( 'bp_' . $this->id . '_meta_tables', $tables ); 536 647 … … 548 659 } 549 660 661 /** 662 * Fires at the end of the register_meta_tables method inside BP_Component. 663 * 664 * This is a dynamic hook that is based on the component string ID. 665 * 666 * @since BuddyPress (2.0.0) 667 */ 550 668 do_action( 'bp_' . $this->id . '_register_meta_tables' ); 551 669 } … … 559 677 */ 560 678 public function register_post_types() { 679 680 /** 681 * Fires in the register_post_types method inside BP_Component. 682 * 683 * This is a dynamic hook that is based on the component string ID. 684 * 685 * @since BuddyPress (1.5.0) 686 */ 561 687 do_action( 'bp_' . $this->id . '_register_post_types' ); 562 688 } … … 570 696 */ 571 697 public function register_taxonomies() { 698 699 /** 700 * Fires in the register_taxonomies method inside BP_Component. 701 * 702 * This is a dynamic hook that is based on the component string ID. 703 * 704 * @since BuddyPress (1.5.0) 705 */ 572 706 do_action( 'bp_' . $this->id . '_register_taxonomies' ); 573 707 } … … 581 715 */ 582 716 public function add_rewrite_tags() { 717 718 /** 719 * Fires in the add_rewrite_tags method inside BP_Component. 720 * 721 * This is a dynamic hook that is based on the component string ID. 722 * 723 * @since BuddyPress (1.5.0) 724 */ 583 725 do_action( 'bp_' . $this->id . '_add_rewrite_tags' ); 584 726 } … … 592 734 */ 593 735 public function add_rewrite_rules() { 736 737 /** 738 * Fires in the add_rewrite_rules method inside BP_Component. 739 * 740 * This is a dynamic hook that is based on the component string ID. 741 * 742 * @since BuddyPress (1.9.0) 743 */ 594 744 do_action( 'bp_' . $this->id . '_add_rewrite_rules' ); 595 745 } … … 603 753 */ 604 754 public function add_permastructs() { 755 756 /** 757 * Fires in the add_permastructs method inside BP_Component. 758 * 759 * This is a dynamic hook that is based on the component string ID. 760 * 761 * @since BuddyPress (1.9.0) 762 */ 605 763 do_action( 'bp_' . $this->id . '_add_permastructs' ); 606 764 } … … 615 773 */ 616 774 public function parse_query( $query ) { 775 776 /** 777 * Fires in the parse_query method inside BP_Component. 778 * 779 * This is a dynamic hook that is based on the component string ID. 780 * 781 * @since BuddyPress (1.9.0) 782 * 783 * @param object $query Main WP_Query object. Passed by reference. 784 */ 617 785 do_action_ref_array( 'bp_' . $this->id . '_parse_query', array( &$query ) ); 618 786 } … … 626 794 */ 627 795 public function generate_rewrite_rules() { 796 797 /** 798 * Fires in the generate_rewrite_rules method inside BP_Component. 799 * 800 * This is a dynamic hook that is based on the component string ID. 801 * 802 * @since BuddyPress (1.5.0) 803 */ 628 804 do_action( 'bp_' . $this->id . '_generate_rewrite_rules' ); 629 805 }
Note: See TracChangeset
for help on using the changeset viewer.