[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-core/classes/ -> class-bp-component.php (summary)

Component classes.

File Size: 1021 lines (28 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

BP_Component:: (22 methods):
  start()
  setup_globals()
  includes()
  late_includes()
  setup_actions()
  setup_canonical_stack()
  setup_nav()
  setup_admin_bar()
  setup_title()
  setup_cache_groups()
  register_global_tables()
  register_meta_tables()
  register_post_types()
  register_taxonomies()
  add_rewrite_tags()
  add_rewrite_rules()
  add_permastructs()
  parse_query()
  generate_rewrite_rules()
  rest_api_init()
  blocks_init()
  admin_directory_states()


Class: BP_Component  - X-Ref

BuddyPress Component Class.

The BuddyPress component class is responsible for simplifying the creation
of components that share similar behaviors and routines. It is used
internally by BuddyPress to create the bundled components, but can be
extended to create other really neat things.

start( $id = '', $name = '', $path = '', $params = array()   X-Ref
Component loader.

param: string $id   Unique ID. Letters, numbers, and underscores only.
param: string $name Unique name. This should be a translatable name, eg.
param: string $path The file path for the component's files. Used by {@link BP_Component::includes()}.
param: array  $params {
since: 1.5.0
since: 1.9.0 Added $params as a parameter.
since: 2.3.0 Added $params['features'] as a configurable value.
since: 2.4.0 Added $params['search_query_arg'] as a configurable value.

setup_globals( $args = array()   X-Ref
Set up component global variables.

param: array $args {
since: 1.5.0
since: 9.0.0 Adds the `$block_globals` argument to the `$args` parameter.

includes( $includes = array()   X-Ref
Include required files.

Please note that, by default, this method is fired on the bp_include
hook, with priority 8. This is necessary so that core components are
loaded in time to be available to third-party plugins. However, this
load order means that third-party plugins whose main files are
loaded at bp_include with priority 10 (as recommended), will not be
loaded in time for their includes() method to fire automatically.

For this reason, it is recommended that your plugin has its own
method or function for requiring necessary files. If you must use
this method, you will have to call it manually in your constructor
class, ie
$this->includes();

Note that when you pass an array value like 'actions' to includes,
it looks for the following three files (assuming your component is
called 'my_component'):
- ./actions
- ./bp-my_component/actions
- ./bp-my_component/bp-my_component-actions.php

param: array $includes An array of file names, or file name chunks,
since: 1.5.0

late_includes()   X-Ref
Late includes method.

Components should include files here only on specific pages using
conditionals such as {@link bp_is_current_component()}. Intentionally left
empty.

since: 3.0.0

setup_actions()   X-Ref
Set up the actions.

since: 1.5.0

setup_canonical_stack()   X-Ref
Set up the canonical URL stack for this component.

since: 2.1.0

setup_nav( $main_nav = array()   X-Ref
Set up component navigation.

param: array $main_nav Optional. Passed directly to bp_core_new_nav_item().
param: array $sub_nav  Optional. Multidimensional array, each item in
since: 1.5.0

setup_admin_bar( $wp_admin_nav = array()   X-Ref
Set up the component entries in the WordPress Admin Bar.

param: array $wp_admin_nav An array of nav item arguments. Each item in this parameter
since: 1.5.0

setup_title()   X-Ref
Set up the component title.

since: 1.5.0

setup_cache_groups()   X-Ref
Setup component-specific cache groups.

since: 2.2.0

register_global_tables( $tables = array()   X-Ref
Register global tables for the component, so that it may use WordPress's database API.

param: array $tables Table names to register.
since: 2.0.0

register_meta_tables( $tables = array()   X-Ref
Register component metadata tables.

Metadata tables are registered in the $wpdb global, for
compatibility with the WordPress metadata API.

param: array $tables Table names to register.
since: 2.0.0

register_post_types()   X-Ref
Set up the component post types.

since: 1.5.0

register_taxonomies()   X-Ref
Register component-specific taxonomies.

since: 1.5.0

add_rewrite_tags()   X-Ref
Add any additional rewrite tags.

since: 1.5.0

add_rewrite_rules()   X-Ref
Add any additional rewrite rules.

since: 1.9.0

add_permastructs()   X-Ref
Add any permalink structures.

since: 1.9.0

parse_query( $query )   X-Ref
Allow components to parse the main query.

param: object $query The main WP_Query.
since: 1.9.0

generate_rewrite_rules()   X-Ref
Generate any additional rewrite rules.

since: 1.5.0

rest_api_init( $controllers = array()   X-Ref
Init the BP REST API.

param: array $controllers The list of BP REST controllers to load.
since: 5.0.0

blocks_init( $blocks = array()   X-Ref
Register the BP Blocks.

param: array $blocks The list of BP Blocks to register.
since: 6.0.0

admin_directory_states( $states = array()   X-Ref
Add component's directory states.

return: array           The component's directory states.
param: string[] $states An array of post display states.
param: WP_Post  $post   The current post object.
since: 10.0.0



Generated: Thu Nov 21 01:00:57 2024 Cross-referenced by PHPXref 0.7.1