[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-core/ -> bp-core-template-loader.php (summary)

BuddyPress Template Functions. This file contains functions necessary to mirror the WordPress core template loading process. Many of those functions are not filterable, and even then would not be robust enough to predict where BuddyPress templates might exist.

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

Defines 17 functions

  bp_get_template_part()
  bp_get_asset_template_part()
  bp_locate_template()
  bp_locate_template_asset()
  bp_register_template_stack()
  bp_deregister_template_stack()
  bp_get_template_stack()
  bp_buffer_template_part()
  bp_get_query_template()
  bp_get_template_locations()
  bp_add_template_stack_locations()
  bp_parse_query()
  bp_template_include_theme_supports()
  bp_set_template_included()
  bp_is_template_included()
  bp_load_theme_functions()
  bp_get_theme_compat_templates()

Functions
Functions that are not part of a class:

bp_get_template_part( $slug, $name = null )   X-Ref
Get a BuddyPress template part for display in a theme.

since: 1.7.0
param: string      $slug Template part slug. Used to generate filenames,
param: string|null $name Optional. Template part name. Used to generate
return: false|string Path to located template. See {@link bp_locate_template()}.

bp_get_asset_template_part( $slug, $name = null )   X-Ref
Get an asset template part.

Basically the same as {@link bp_get_template_part()}, but with 'assets/'
prepended to the slug.

since: 2.6.0
param: string      $slug Template slug.
param: string|null $name Template name.
return: false|string

bp_locate_template( $template_names, $load = false, $require_once = true )   X-Ref
Retrieve the name of the highest priority template file that exists.

Searches in the STYLESHEETPATH before TEMPLATEPATH so that themes which
inherit from a parent theme can just overload one file. If the template is
not found in either of those, it looks in the theme-compat folder last.

since: 1.7.0
param: string|array $template_names Template file(s) to search for, in order.
param: bool         $load           Optional. If true, the template file will be loaded when
param: bool         $require_once   Optional. Whether to require_once or require. Has
return: string The template filename if one is located.

bp_locate_template_asset( $filename )   X-Ref
Get file data of the highest priority asset that exists.

Similar to {@link bp_locate_template()}, but for files like CSS and JS.

since: 2.6.0
param: string $filename Relative filename to search for.
return: false|array Array of asset data if one is located (includes absolute filepath and URI).

bp_register_template_stack( $location_callback = '', $priority = 10 )   X-Ref
Register a new template stack location.

This allows for templates to live in places beyond just the parent/child
relationship, to allow for custom template locations. Used in conjunction
with bp_locate_template(), this allows for easy template overrides.

since: 1.7.0
param: string $location_callback Callback function that returns the stack location.
param: int    $priority          Optional. The priority parameter as passed to
return: bool See {@link add_filter()}.

bp_deregister_template_stack( $location_callback = '', $priority = 10 )   X-Ref
Deregister a previously registered template stack location.

since: 1.7.0
param: string $location_callback Callback function that returns the stack location.
param: int    $priority          Optional. The priority parameter passed to
return: bool See {@link remove_filter()}.

bp_get_template_stack()   X-Ref
Get the "template stack", a list of registered directories where templates can be found.

Calls the functions added to the 'bp_template_stack' filter hook, and return
an array of the template locations.

since: 1.7.0
return: array The filtered value after all hooked functions are applied to it.

bp_buffer_template_part( $slug, $name = null, $echo = true )   X-Ref
Put a template part into an output buffer, and return it.

since: 1.7.0
param: string      $slug See {@link bp_get_template_part()}.
param: string|null $name See {@link bp_get_template_part()}.
param: bool        $echo If true, template content will be echoed. If false,
return: string|null If $echo, returns the template content.

bp_get_query_template( $type, $templates = array()   X-Ref
Retrieve the path to a template.

Used to quickly retrieve the path of a template without including the file
extension. It will also check the parent theme and theme-compat theme with
the use of {@link bp_locate_template()}. Allows for more generic template
locations without the use of the other get_*_template() functions.

since: 1.7.0
param: string $type      Filename without extension.
param: array  $templates An optional list of template candidates.
return: string Full path to file.

bp_get_template_locations( $templates = array()   X-Ref
Get the possible subdirectories to check for templates in.

since: 1.7.0
param: array $templates Templates we are looking for.
return: array Possible subfolders to look in.

bp_add_template_stack_locations( $stacks = array()   X-Ref
Add template locations to template files being searched for.

since: 1.7.0
param: array $stacks Array of template locations.
return: array Array of all template locations registered so far.

bp_parse_query( $posts_query )   X-Ref
Add checks for BuddyPress conditions to 'parse_query' action.

since: 1.7.0
param: WP_Query $posts_query WP_Query object.

bp_template_include_theme_supports( $template = '' )   X-Ref
Possibly intercept the template being loaded.

Listens to the 'template_include' filter and waits for any BuddyPress specific
template condition to be met. If one is met and the template file exists,
it will be used; otherwise.

Note that the _edit() checks are ahead of their counterparts, to prevent them
from being stomped on accident.

since: 1.7.0
param: string $template The path to the template file that is being used.
return: string The path to the template file that is being used.

bp_set_template_included( $template = false )   X-Ref
Set the included template.

since: 1.8.0
param: mixed $template Default: false.
return: mixed False if empty. Template name if template included.

bp_is_template_included()   X-Ref
Is a BuddyPress template being included?

since: 1.8.0
return: bool True if yes, false if no.

bp_load_theme_functions()   X-Ref
Attempt to load a custom BP functions file, similar to each themes functions.php file.

since: 1.7.0

bp_get_theme_compat_templates()   X-Ref
Get the templates to use as the endpoint for BuddyPress template parts.

since: 1.7.0
since: 2.4.0 Added singular.php to stack
return: string Possible root level wrapper template files.



Generated: Wed Jul 8 01:01:32 2020 Cross-referenced by PHPXref 0.7.1