[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-core/ -> bp-core-filters.php (summary)

BuddyPress Filters. This file contains the filters that are used throughout BuddyPress. They are consolidated here to make searching for them easier, and to help developers understand at a glance the order in which things occur.

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

Defines 24 functions

  bp_core_exclude_pages()
  bp_core_exclude_pages_from_nav_menu_admin()
  bp_core_menu_highlight_parent_page()
  bp_core_menu_highlight_nav_menu_item()
  bp_core_filter_comments()
  bp_core_login_redirect()
  bp_email_plaintext_entity_decode()
  bp_core_filter_user_welcome_email()
  bp_core_filter_blog_welcome_email()
  bp_core_activation_signup_blog_notification()
  bp_core_activation_signup_user_notification()
  bp_modify_page_title()
  bp_modify_document_title_parts()
  bp_setup_nav_menu_item()
  bp_customizer_nav_menus_get_items()
  bp_customizer_nav_menus_set_item_types()
  bp_filter_metaid_column_name()
  bp_core_filter_edit_post_link()
  bp_maybe_load_mentions_scripts_for_blog_content()
  _bp_core_inject_bp_widget_css_class()
  bp_email_add_link_color_to_template()
  bp_email_set_default_headers()
  bp_email_set_default_tokens()
  bp_core_render_email_template()

Functions
Functions that are not part of a class:

bp_core_exclude_pages( $pages = array()   X-Ref
Prevent specific pages (eg 'Activate') from showing on page listings.

since: 1.5.0
return: array The exclude list, with BP's pages added.
param: array $pages List of excluded page IDs, as passed to the

bp_core_exclude_pages_from_nav_menu_admin( $object = null )   X-Ref
Prevent specific pages (eg 'Activate') from showing in the Pages meta box of the Menu Administration screen.

since: 2.0.0
return: object|null The $object, with a query argument to remove register and activate pages id.
param: object|null $object The post type object used in the meta box.

bp_core_menu_highlight_parent_page( $retval, $page )   X-Ref
Adds current page CSS classes to the parent BP page in a WP Page Menu.

Because BuddyPress primarily uses virtual pages, we need a way to highlight
the BP parent page during WP menu generation.  This function checks the
current BP component against the current page in the WP menu to see if we
should highlight the WP page.

since: 2.2.0
return: array
param: array   $retval CSS classes for the current menu page in the menu.
param: WP_Post $page   The page properties for the current menu item.

bp_core_menu_highlight_nav_menu_item( $retval, $item )   X-Ref
Adds current page CSS classes to the parent BP page in a WP Nav Menu.

When {@link wp_nav_menu()} is used, this function helps to highlight the
current BP parent page during nav menu generation.

since: 2.2.0
return: array
param: array   $retval CSS classes for the current nav menu item in the menu.
param: WP_Post $item   The properties for the current nav menu item.

bp_core_filter_comments( $comments, $post_id )   X-Ref
Filter the blog post comments array and insert BuddyPress URLs for users.

since: 1.2.0
return: array $comments The modified comment array.
param: array $comments The array of comments supplied to the comments template.
param: int   $post_id  The post ID.

bp_core_login_redirect( $redirect_to, $redirect_to_raw, $user )   X-Ref
When a user logs in, redirect him in a logical way.

since: 1.2.0
return: string The redirect URL.
param: string  $redirect_to     The URL to be redirected to, sanitized in wp-login.php.
param: string  $redirect_to_raw The unsanitized redirect_to URL ($_REQUEST['redirect_to']).
param: WP_User $user            The WP_User object corresponding to a successfully

bp_email_plaintext_entity_decode( $retval, $prop, $transform )   X-Ref
Decode HTML entities for plain-text emails.

since: 2.5.0
return: string|null $retval Modified email content.
param: string $retval    Current email content.
param: string $prop      Email property to check against.
param: string $transform Either 'raw' or 'replace-tokens'.

bp_core_filter_user_welcome_email( $welcome_email )   X-Ref
Replace the generated password in the welcome email with '[User Set]'.

On a standard BP installation, users who register themselves also set their
own passwords. Therefore there is no need for the insecure practice of
emailing the plaintext password to the user in the welcome email.

This filter will not fire when a user is registered by the site admin.

since: 1.2.1
return: string Filtered $welcome_email with the password replaced
param: string $welcome_email Complete email passed through WordPress.

bp_core_filter_blog_welcome_email( $welcome_email, $blog_id, $user_id, $password )   X-Ref
Replace the generated password in the welcome email with '[User Set]'.

On a standard BP installation, users who register themselves also set their
own passwords. Therefore there is no need for the insecure practice of
emailing the plaintext password to the user in the welcome email.

This filter will not fire when a user is registered by the site admin.

since: 1.2.1
return: string Filtered $welcome_email with $password replaced by '[User Set]'.
param: string $welcome_email Complete email passed through WordPress.
param: int    $blog_id       ID of the blog user is joining.
param: int    $user_id       ID of the user joining.
param: string $password      Password of user.

bp_core_activation_signup_blog_notification( $domain, $path, $title, $user, $user_email, $key )   X-Ref
Notify new users of a successful registration (with blog).

This function filter's WP's 'wpmu_signup_blog_notification', and replaces
WP's default welcome email with a BuddyPress-specific message.

since: 1.0.0
return: bool              Returns false to stop original WPMU function from continuing.
param: string $domain     The new blog domain.
param: string $path       The new blog path.
param: string $title      The site title.
param: string $user       The user's login name.
param: string $user_email The user's email address.
param: string $key        The activation key created in wpmu_signup_blog().

bp_core_activation_signup_user_notification( $user, $user_email, $key, $meta )   X-Ref
Notify new users of a successful registration (without blog).

since: 1.0.0
return: false|string Returns false to stop original WPMU function from continuing.
param: string $user       The user's login name.
param: string $user_email The user's email address.
param: string $key        The activation key created in wpmu_signup_user().
param: array  $meta       By default, an empty array.

bp_modify_page_title( $title = '', $sep = '»', $seplocation = 'right' )   X-Ref
Filter the page title for BuddyPress pages.

since: 1.5.0
return: string              New page title.
param: string $title       Original page title.
param: string $sep         How to separate the various items within the page title.
param: string $seplocation Direction to display title.

bp_modify_document_title_parts( $title = array()   X-Ref
Filter the document title for BuddyPress pages.

since: 2.4.3
return: array the unchanged title parts or the BuddyPress ones
param: array $title The WordPress document title parts.

bp_setup_nav_menu_item( $menu_item )   X-Ref
Add BuddyPress-specific items to the wp_nav_menu.

since: 1.9.0
return: WP_Post The modified WP_Post object.
param: WP_Post $menu_item The menu item.

bp_customizer_nav_menus_get_items( $items = array()   X-Ref
Populate BuddyPress user nav items for the customizer.

since: 2.3.3
return: array The paginated BuddyPress user nav items.
param: array   $items  The array of menu items.
param: string  $type   The requested type.
param: string  $object The requested object name.
param: integer $page   The page num being requested.

bp_customizer_nav_menus_set_item_types( $item_types = array()   X-Ref
Set BuddyPress item navs for the customizer.

since: 2.3.3
return: array $item_types An associative array structured for the customizer.
param: array $item_types An associative array structured for the customizer.

bp_filter_metaid_column_name( $q )   X-Ref
Filter SQL query strings to swap out the 'meta_id' column.

WordPress uses the meta_id column for commentmeta and postmeta, and so
hardcodes the column name into its *_metadata() functions. BuddyPress, on
the other hand, uses 'id' for the primary column. To make WP's functions
usable for BuddyPress, we use this just-in-time filter on 'query' to swap
'meta_id' with 'id.

since: 2.0.0
return: string
param: string $q SQL query.

bp_core_filter_edit_post_link( $edit_link = '', $post_id = 0 )   X-Ref
Filter the edit post link to avoid its display in BuddyPress pages.

since: 2.1.0
return: false|string Will be a boolean (false) if $post_id is 0. Will be a string (the unchanged edit link)
param: string $edit_link The edit link.
param: int    $post_id   Post ID.

bp_maybe_load_mentions_scripts_for_blog_content( $load_mentions, $mentions_enabled )   X-Ref
Should BuddyPress load the mentions scripts and related assets, including results to prime the
mentions suggestions?

since: 2.2.0
return: bool True if mentions scripts should be loaded.
param: bool $load_mentions    True to load mentions assets, false otherwise.
param: bool $mentions_enabled True if mentions are enabled.

_bp_core_inject_bp_widget_css_class( $params )   X-Ref
Injects specific BuddyPress CSS classes into a widget sidebar.

Helps to standardize styling of BuddyPress widgets within a theme that
does not use dynamic CSS classes in their widget sidebar's 'before_widget'
call.

since: 2.4.0
return: array
param: array $params Current sidebar params.

bp_email_add_link_color_to_template( $value, $property_name, $transform )   X-Ref
Add email link styles to rendered email template.

This is only used when the email content has been merged into the email template.

since: 2.5.0
return: string Updated value.
param: string $value         Property value.
param: string $property_name Email template property name.
param: string $transform     How the return value was transformed.

bp_email_set_default_headers( $headers, $property, $transform, $email )   X-Ref
Add custom headers to outgoing emails.

since: 2.5.0
return: array
param: array    $headers   Array of email headers.
param: string   $property  Name of property. Unused.
param: string   $transform Return value transformation. Unused.
param: BP_Email $email     Email object reference.

bp_email_set_default_tokens( $tokens, $property_name, $transform, $email )   X-Ref
Add default email tokens.

since: 2.5.0
return: array
param: array    $tokens        Email tokens.
param: string   $property_name Unused.
param: string   $transform     Unused.
param: BP_Email $email         Email being sent.

bp_core_render_email_template( $template )   X-Ref
Find and render the template for Email posts (the Customizer and admin previews).

Misuses the `template_include` filter which expects a string, but as we need to replace
the `{{{content}}}` token with the post's content, we use object buffering to load the
template, replace the token, and render it.

The function returns an empty string to prevent WordPress rendering another template.

since: 2.5.0
return: string
param: string $template Path to template (probably single.php).



Generated: Wed Jul 24 01:01:43 2019 Cross-referenced by PHPXref 0.7.1