[ 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: 701 lines (21 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 18 functions

  bp_get_template_part()
  bp_get_asset_template_part()
  bp_get_dynamic_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, $args = array()   X-Ref
Get a BuddyPress template part for display in a theme.

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

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

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

param: string      $slug Template slug.
param: string|null $name Template name.
param: array       $args Optional. Extra args to pass to locate_template().
since: 2.6.0
since: 7.0.0 Added $args parameter.
return: false|string

bp_get_dynamic_template_part( $template = '', $type = 'js', $tokens = array()   X-Ref
Get a dynamic template part.

param: string $template     The Template Pack's relative path to the templata.
param: string $type         Whether to use the template for JavaScript or PHP.
param: array  $tokens       The data to use to customize the template. Optional.
param: array  $allowed_tags The allowed tags to use. Optional.
since: 9.0.0
return: string HTML/JS output.

bp_locate_template( $template_names, $load = false, $require_once = true, $args = array()   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.

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
param: array        $args           Optional. Extra args to pass to locate_template().
since: 1.7.0
since: 7.0.0 Added $args parameter.
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.

param: string $filename Relative filename to search for.
since: 2.6.0
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.

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

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

param: string $location_callback Callback function that returns the stack location.
param: int    $priority          Optional. The priority parameter passed to
since: 1.7.0
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, $args = array()   X-Ref
Put a template part into an output buffer, and return it.

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,
param: array       $args See {@link bp_get_template_part()}.
since: 1.7.0
since: 7.0.0 Added $args parameter.
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.

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

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

param: array $templates Templates we are looking for.
since: 1.7.0
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.

param: array $stacks Array of template locations.
since: 1.7.0
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.

param: WP_Query $posts_query WP_Query object.
since: 1.7.0

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.

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

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

param: mixed $template Default: false.
since: 1.8.0
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: Sun Dec 22 01:00:54 2024 Cross-referenced by PHPXref 0.7.1