Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/24/2015 06:19:49 AM (7 years ago)
Author:
tw2113
Message:

Adds hooks documentation to bp-core-component.php and bp-core-dependency.php.

See #5940.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-component.php

    r9351 r9641  
    223223        ) );
    224224
    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         */
    226232        $this->slug                  = apply_filters( 'bp_' . $this->id . '_slug',                  $r['slug']                  );
    227233
    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         */
    229241        $this->root_slug             = apply_filters( 'bp_' . $this->id . '_root_slug',             $r['root_slug']             );
    230242
    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         */
    232250        $this->has_directory         = apply_filters( 'bp_' . $this->id . '_has_directory',         $r['has_directory']         );
    233251
    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         */
    235259        $this->directory_title       = apply_filters( 'bp_' . $this->id . '_directory_title',       $r['directory_title']         );
    236260
    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         */
    238268        $this->search_string         = apply_filters( 'bp_' . $this->id . '_search_string',         $r['search_string']         );
    239269
    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         */
    241277        $this->notification_callback = apply_filters( 'bp_' . $this->id . '_notification_callback', $r['notification_callback'] );
    242278
     
    256292        buddypress()->loaded_components[$this->slug] = $this->id;
    257293
    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         */
    259301        do_action( 'bp_' . $this->id . '_setup_globals' );
    260302    }
     
    321363        }
    322364
    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         */
    324372        do_action( 'bp_' . $this->id . '_includes' );
    325373    }
     
    381429        add_action( 'bp_generate_rewrite_rules', array( $this, 'generate_rewrite_rules' ), 10 );
    382430
    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         */
    384438        do_action( 'bp_' . $this->id . '_setup_actions' );
    385439    }
     
    420474        }
    421475
    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         */
    423483        do_action( 'bp_' . $this->id . '_setup_nav' );
    424484    }
     
    448508        }
    449509
    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         */
    451519        $wp_admin_nav = apply_filters( 'bp_' . $this->id . '_admin_nav', $wp_admin_nav );
    452520
     
    466534        }
    467535
    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         */
    469543        do_action( 'bp_' . $this->id . '_setup_admin_bar' );
    470544    }
     
    478552     */
    479553    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         */
    480562        do_action(  'bp_' . $this->id . '_setup_title' );
    481563    }
     
    489571     */
    490572    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         */
    491581        do_action( 'bp_' . $this->id . '_setup_cache_groups' );
    492582    }
     
    501591    public function register_global_tables( $tables = array() ) {
    502592
    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         */
    505602        $tables = apply_filters( 'bp_' . $this->id . '_global_tables', $tables );
    506603
     
    515612        }
    516613
     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         */
    517621        do_action( 'bp_' . $this->id . '_register_global_tables' );
    518622    }
     
    531635        global $wpdb;
    532636
    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         */
    535646        $tables = apply_filters( 'bp_' . $this->id . '_meta_tables', $tables );
    536647
     
    548659        }
    549660
     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         */
    550668        do_action( 'bp_' . $this->id . '_register_meta_tables' );
    551669    }
     
    559677     */
    560678    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         */
    561687        do_action( 'bp_' . $this->id . '_register_post_types' );
    562688    }
     
    570696     */
    571697    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         */
    572706        do_action( 'bp_' . $this->id . '_register_taxonomies' );
    573707    }
     
    581715     */
    582716    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         */
    583725        do_action( 'bp_' . $this->id . '_add_rewrite_tags' );
    584726    }
     
    592734     */
    593735    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         */
    594744        do_action( 'bp_' . $this->id . '_add_rewrite_rules' );
    595745    }
     
    603753     */
    604754    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         */
    605763        do_action( 'bp_' . $this->id . '_add_permastructs' );
    606764    }
     
    615773     */
    616774    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         */
    617785        do_action_ref_array( 'bp_' . $this->id . '_parse_query', array( &$query ) );
    618786    }
     
    626794     */
    627795    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         */
    628804        do_action( 'bp_' . $this->id . '_generate_rewrite_rules' );
    629805    }
Note: See TracChangeset for help on using the changeset viewer.