[ Index ]

PHP Cross Reference of BBPress

title

Body

[close]

/src/includes/common/ -> template.php (summary)

bbPress Common Template Tags Common template tags are ones that are used by more than one component, like forums, topics, replies, users, topic tags, etc...

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

Defines 86 functions

  bbp_forums_url()
  bbp_get_forums_url()
  bbp_topics_url()
  bbp_get_topics_url()
  bbp_head()
  bbp_footer()
  bbp_is_site_public()
  bbp_is_forum()
  bbp_is_forum_archive()
  bbp_is_single_forum()
  bbp_is_forum_edit()
  bbp_is_topic()
  bbp_is_single_topic()
  bbp_is_topic_archive()
  bbp_is_topic_edit()
  bbp_is_topic_merge()
  bbp_is_topic_split()
  bbp_is_topic_tag()
  bbp_is_topic_tag_edit()
  bbp_is_custom_post_type()
  bbp_is_reply()
  bbp_is_reply_edit()
  bbp_is_reply_move()
  bbp_is_single_reply()
  bbp_is_favorites()
  bbp_is_subscriptions()
  bbp_is_topics_created()
  bbp_is_replies_created()
  bbp_is_user_home()
  bbp_is_user_home_edit()
  bbp_is_single_user()
  bbp_is_single_user_edit()
  bbp_is_single_user_profile()
  bbp_is_single_user_topics()
  bbp_is_single_user_replies()
  bbp_is_single_user_engagements()
  bbp_is_single_view()
  bbp_is_search()
  bbp_is_search_results()
  bbp_is_edit()
  bbp_body_class()
  bbp_swap_no_js_body_class()
  bbp_has_shortcode()
  is_bbpress()
  bbp_wp_login_action()
  bbp_get_wp_login_action()
  bbp_redirect_to_field()
  bbp_sanitize_val()
  bbp_get_sanitize_val()
  bbp_tab_index()
  bbp_get_tab_index()
  bbp_tab_index_attribute()
  bbp_get_tab_index_attribute()
  bbp_dropdown()
  bbp_get_dropdown()
  bbp_forum_form_fields()
  bbp_topic_form_fields()
  bbp_reply_form_fields()
  bbp_edit_user_form_fields()
  bbp_merge_topic_form_fields()
  bbp_split_topic_form_fields()
  bbp_move_reply_form_fields()
  bbp_the_content()
  bbp_get_the_content()
  bbp_get_tiny_mce_plugins()
  bbp_get_teeny_mce_buttons()
  bbp_get_quicktags_settings()
  bbp_view_id()
  bbp_get_view_id()
  bbp_view_title()
  bbp_get_view_title()
  bbp_view_url()
  bbp_get_view_url()
  bbp_is_query_name()
  bbp_get_query_name()
  bbp_set_query_name()
  bbp_reset_query_name()
  bbp_title_breadcrumb()
  bbp_breadcrumb()
  bbp_get_breadcrumb()
  bbp_allowed_tags()
  bbp_get_allowed_tags()
  bbp_template_notices()
  bbp_logout_link()
  bbp_get_logout_link()
  bbp_title()

Functions
Functions that are not part of a class:

bbp_forums_url( $path = '/' )   X-Ref
Output the forum URL

param: string $path Additional path with leading slash
since: 2.1.0 bbPress (r3979)

bbp_get_forums_url( $path = '/' )   X-Ref
Return the forum URL

param: string $path Additional path with leading slash
since: 2.1.0 bbPress (r3979)

bbp_topics_url( $path = '/' )   X-Ref
Output the forum URL

param: string $path Additional path with leading slash
since: 2.1.0 bbPress (r3979)

bbp_get_topics_url( $path = '/' )   X-Ref
Return the forum URL

param: string $path Additional path with leading slash
since: 2.1.0 bbPress (r3979)
return: The URL to the topics archive

bbp_head()   X-Ref
Add our custom head action to wp_head

since: 2.0.0 bbPress (r2464)

bbp_footer()   X-Ref
Add our custom footer action to wp_footer

since: 2.0.0 bbPress (r2464)

bbp_is_site_public( $site_id = 0 )   X-Ref
Check if current site is public

param: int $site_id
since: 2.0.0 bbPress (r3398)
return: bool True if site is public, false if private

bbp_is_forum( $post_id = 0 )   X-Ref
Check if current page is a bbPress forum

param: int $post_id Possible post_id to check
since: 2.0.0 bbPress (r2549)
return: bool True if it's a forum page, false if not

bbp_is_forum_archive()   X-Ref
Check if we are viewing a forum archive.

since: 2.0.0 bbPress (r3251)
return: bool

bbp_is_single_forum()   X-Ref
Viewing a single forum

since: 2.0.0 bbPress (r3338)
return: bool

bbp_is_forum_edit()   X-Ref
Check if current page is a forum edit page

since: 2.1.0 bbPress (r3553)
return: bool True if it's the forum edit page, false if not

bbp_is_topic( $post_id = 0 )   X-Ref
Check if current page is a bbPress topic

param: int $post_id Possible post_id to check
since: 2.0.0 bbPress (r2549)
return: bool True if it's a topic page, false if not

bbp_is_single_topic()   X-Ref
Viewing a single topic

since: 2.0.0 bbPress (r3338)
return: bool

bbp_is_topic_archive()   X-Ref
Check if we are viewing a topic archive.

since: 2.0.0 bbPress (r3251)
return: bool

bbp_is_topic_edit()   X-Ref
Check if current page is a topic edit page

since: 2.0.0 bbPress (r2753)
return: bool True if it's the topic edit page, false if not

bbp_is_topic_merge()   X-Ref
Check if current page is a topic merge page

since: 2.0.0 bbPress (r2756)
return: bool True if it's the topic merge page, false if not

bbp_is_topic_split()   X-Ref
Check if current page is a topic split page

since: 2.0.0 bbPress (r2756)
return: bool True if it's the topic split page, false if not

bbp_is_topic_tag()   X-Ref
Check if the current page is a topic tag

since: 2.0.0 bbPress (r3311)
return: bool True if it's a topic tag, false if not

bbp_is_topic_tag_edit()   X-Ref
Check if the current page is editing a topic tag

since: 2.0.0 bbPress (r3346)
return: bool True if editing a topic tag, false if not

bbp_is_custom_post_type( $the_post = false )   X-Ref
Check if the current post type is one that comes with bbPress

param: mixed $the_post Optional. Post object or post ID.
since: 2.0.0 bbPress (r3311)
return: bool

bbp_is_reply( $post_id = 0 )   X-Ref
Check if current page is a bbPress reply

param: int $post_id Possible post_id to check
since: 2.0.0 bbPress (r2549)
return: bool True if it's a reply page, false if not

bbp_is_reply_edit()   X-Ref
Check if current page is a reply edit page

since: 2.0.0 bbPress (r2753)
return: bool True if it's the reply edit page, false if not

bbp_is_reply_move()   X-Ref
Check if current page is a reply move page

return: bool True if it's the reply move page, false if not

bbp_is_single_reply()   X-Ref
Viewing a single reply

since: 2.0.0 bbPress (r3344)
return: bool

bbp_is_favorites()   X-Ref
Check if current page is a bbPress user's favorites page (profile page)

since: 2.0.0 bbPress (r2652)
return: bool True if it's the favorites page, false if not

bbp_is_subscriptions()   X-Ref
Check if current page is a bbPress user's subscriptions page (profile page)

since: 2.0.0 bbPress (r2652)
return: bool True if it's the subscriptions page, false if not

bbp_is_topics_created()   X-Ref
Check if current page shows the topics created by a bbPress user (profile
page)

since: 2.0.0 bbPress (r2688)
return: bool True if it's the topics created page, false if not

bbp_is_replies_created()   X-Ref
Check if current page shows the replies created by a bbPress user (profile
page)

since: 2.2.0 bbPress (r4225)
return: bool True if it's the replies created page, false if not

bbp_is_user_home()   X-Ref
Check if current page is the currently logged in users author page

since: 2.0.0 bbPress (r2688)
return: bool True if it's the user's home, false if not

bbp_is_user_home_edit()   X-Ref
Check if current page is the currently logged in users author edit page

since: 2.1.0 bbPress (r3918)
return: bool True if it's the user's home, false if not

bbp_is_single_user()   X-Ref
Check if current page is a user profile page

since: 2.0.0 bbPress (r2688)
return: bool True if it's a user's profile page, false if not

bbp_is_single_user_edit()   X-Ref
Check if current page is a user profile edit page

since: 2.0.0 bbPress (r2688)
return: bool True if it's a user's profile edit page, false if not

bbp_is_single_user_profile()   X-Ref
Check if current page is a user profile page

since: 2.2.0 bbPress (r4225)
return: bool True if it's a user's profile page, false if not

bbp_is_single_user_topics()   X-Ref
Check if current page is a user topics created page

since: 2.2.0 bbPress (r4225)
return: bool True if it's a user's topics page, false if not

bbp_is_single_user_replies()   X-Ref
Check if current page is a user replies created page

since: 2.2.0 bbPress (r4225)
return: bool True if it's a user's replies page, false if not

bbp_is_single_user_engagements()   X-Ref
Check if current page is a user engagements page

since: 2.6.0 bbPress (r6320)
return: bool True if it's a user's replies page, false if not

bbp_is_single_view()   X-Ref
Check if current page is a view page

since: 2.0.0 bbPress (r2789)
return: bool Is it a view page?

bbp_is_search()   X-Ref
Check if current page is a search page

since: 2.3.0 bbPress (r4579)
return: bool Is it a search page?

bbp_is_search_results()   X-Ref
Check if current page is a search results page

since: 2.4.0 bbPress (r4919)
return: bool Is it a search page?

bbp_is_edit()   X-Ref
Check if current page is an edit page

since: 2.1.0 bbPress (r3585)
return: bool True if it's the edit page, false if not

bbp_body_class( $wp_classes = array()   X-Ref
Use the above is_() functions to output a body class for each scenario

param: array $wp_classes
param: array $custom_classes
since: 2.0.0 bbPress (r2926)
return: array Body Classes

bbp_swap_no_js_body_class()   X-Ref
Output a small piece of JavaScript to replace the "bbp-no-js" body class
with "bbp-js" to allow interactive & dynamic elements to work as intended.

since: 2.6.10 bbPress (r7229)

bbp_has_shortcode( $text = '' )   X-Ref
Check if text contains a bbPress shortcode.

Loops through registered bbPress shortcodes and keeps track of which ones
were used in a blob of text. If no text is passed, the current global post
content is assumed.

A preliminary strpos() is performed before looping through each shortcode, to
prevent unnecessarily processing.

param: string $text
since: 2.6.0
return: bool

is_bbpress()   X-Ref
Use the above is_() functions to return if in any bbPress page

since: 2.0.0 bbPress (r3344)
return: bool In a bbPress page

bbp_wp_login_action( $args = array()   X-Ref
Output the login form action url

param: array $args This function supports these arguments:
since: 2.0.0 bbPress (r2815)

bbp_get_wp_login_action( $args = array()   X-Ref
Return the login form action url

param: array $args This function supports these arguments:
since: 2.6.0 bbPress (r5684)

bbp_redirect_to_field( $redirect_to = '' )   X-Ref
Output hidden request URI field for user forms.

The referer link is the current Request URI from the server super global. To
check the field manually, use bbp_get_redirect_to().

param: string $redirect_to Pass a URL to redirect to
since: 2.0.0 bbPress (r2815)

bbp_sanitize_val( $request = '', $input_type = 'text' )   X-Ref
Echo sanitized $_REQUEST value.

Use the $input_type parameter to properly process the value. This
ensures correct sanitization of the value for the receiving input.

param: string $request Name of $_REQUEST to look for
param: string $input_type Type of input. Default: text. Accepts:
since: 2.0.0 bbPress (r2815)

bbp_get_sanitize_val( $request = '', $input_type = 'text' )   X-Ref
Return sanitized $_REQUEST value.

Use the $input_type parameter to properly process the value. This
ensures correct sanitization of the value for the receiving input.

param: string $request Name of $_REQUEST to look for
param: string $input_type Type of input. Default: text. Accepts:
since: 2.0.0 bbPress (r2815)
return: string Sanitized value ready for screen display

bbp_tab_index( $auto_increment = true )   X-Ref
Output the current tab index of a given form

Use this function to handle the tab indexing of user facing forms within a
template file. Calling this function will automatically increment the global
tab index by default.

param: int $auto_increment Optional. Default true. Set to false to prevent
since: 2.0.0 bbPress (r2810)

bbp_get_tab_index( $auto_increment = true )   X-Ref
Return the current tab index of a given form

Use this function to handle the tab indexing of user facing forms
within a template file. Calling this function will automatically
increment the global tab index by default.

param: int $auto_increment Optional. Default true. Set to false to
since: 2.0.0 bbPress (r2810)
return: int $bbp->tab_index The global tab index

bbp_tab_index_attribute( $tab = false )   X-Ref
Output a "tabindex" attribute for an element, if an index was passed.

This helper function is in use, but it is generally considered impolite to
override the "tabindex" attribute beyond what the browser naturally assigns.

Most internal usages pass `false` which results in no attribute being used.

param: mixed $tab False to skip, any integer to use
since: 2.6.0 bbPress (r6424)

bbp_get_tab_index_attribute( $tab = false )   X-Ref
Return a "tabindex" attribute for an element, if an index was passed.

This helper function is in use, but it is generally considered impolite to
override the "tabindex" attribute beyond what the browser naturally assigns.

Most internal usages pass `false` which results in no attribute being used.

param: mixed $tab False to skip, any integer to use
since: 2.6.0 bbPress (r6424)
return: string

bbp_dropdown( $args = array()   X-Ref
Output a select box allowing to pick which forum/topic a new topic/reply
belongs in.

Can be used for any post type, but is mostly used for topics and forums.

param: array $args See {@link bbp_get_dropdown()} for arguments
since: 2.0.0 bbPress (r2746)

bbp_get_dropdown( $args = array()   X-Ref
Return a select box allowing to pick which forum/topic a new
topic/reply belongs in.

param: array $args The function supports these args:
since: 2.0.0 bbPress (r2746)
return: string The dropdown

bbp_forum_form_fields()   X-Ref
Output the required hidden fields when creating/editing a forum

since: 2.1.0 bbPress (r3553)

bbp_topic_form_fields()   X-Ref
Output the required hidden fields when creating/editing a topic

since: 2.0.0 bbPress (r2753)

bbp_reply_form_fields()   X-Ref
Output the required hidden fields when creating/editing a reply

since: 2.0.0 bbPress (r2753)

bbp_edit_user_form_fields()   X-Ref
Output the required hidden fields when editing a user

since: 2.0.0 bbPress (r2690)

bbp_merge_topic_form_fields()   X-Ref
Merge topic form fields

Output the required hidden fields when merging a topic

since: 2.0.0 bbPress (r2756)

bbp_split_topic_form_fields()   X-Ref
Split topic form fields

Output the required hidden fields when splitting a topic

since: 2.0.0 bbPress (r2756)

bbp_move_reply_form_fields()   X-Ref
Move reply form fields

Output the required hidden fields when moving a reply

bbp_the_content( $args = array()   X-Ref
Output a textarea or TinyMCE if enabled

param: array $args
since: 2.1.0 bbPress (r3586)

bbp_get_the_content( $args = array()   X-Ref
Return a textarea or TinyMCE if enabled

param: array $args
since: 2.1.0 bbPress (r3586)
return: string HTML from output buffer

bbp_get_tiny_mce_plugins( $plugins = array()   X-Ref
Edit TinyMCE plugins to match core behaviour

param: array $plugins
since: 2.3.0 bbPress (r4574)
return: array

bbp_get_teeny_mce_buttons( $buttons = array()   X-Ref
Edit TeenyMCE buttons to match allowedtags

param: array $buttons
since: 2.3.0 bbPress (r4605)
return: array

bbp_get_quicktags_settings( $settings = array()   X-Ref
Edit TinyMCE quicktags buttons to match allowedtags

param: array $settings
since: 2.3.0 bbPress (r4606)
return: array Quicktags settings

bbp_view_id( $view = '' )   X-Ref
Output the view id

param: string $view Optional. View id
since: 2.0.0 bbPress (r2789)

bbp_get_view_id( $view = '' )   X-Ref
Get the view id

Use view id if supplied, otherwise bbp_get_view_rewrite_id() query var.

param: string $view Optional. View id.
since: 2.0.0 bbPress (r2789)
return: bool|string ID on success, false on failure

bbp_view_title( $view = '' )   X-Ref
Output the view name aka title

param: string $view Optional. View id
since: 2.0.0 bbPress (r2789)

bbp_get_view_title( $view = '' )   X-Ref
Get the view name aka title

If a view id is supplied, that is used. Otherwise the bbp_view
query var is checked for.

param: string $view Optional. View id
since: 2.0.0 bbPress (r2789)
return: bool|string Title on success, false on failure

bbp_view_url( $view = false )   X-Ref
Output the view url

param: string $view Optional. View id
since: 2.0.0 bbPress (r2789)

bbp_get_view_url( $view = false )   X-Ref
Return the view url

param: string $view Optional. View id
since: 2.0.0 bbPress (r2789)
return: string View url (or home url if the view was not found)

bbp_is_query_name( $name = '' )   X-Ref
Check the passed parameter against the current _bbp_query_name

since: 2.0.0 bbPress (r2980)
return: bool True if match, false if not

bbp_get_query_name()   X-Ref
Get the '_bbp_query_name' setting

since: 2.0.0 bbPress (r2695)
return: string To return the query var value

bbp_set_query_name( $name = '' )   X-Ref
Set the '_bbp_query_name' setting to $name

param: string $name What to set the query var to
since: 2.0.0 bbPress (r2692)

bbp_reset_query_name()   X-Ref
Used to clear the '_bbp_query_name' setting

since: 2.0.0 bbPress (r2692)

bbp_title_breadcrumb( $args = array()   X-Ref
Output the page title as a breadcrumb

param: string $sep Separator. Defaults to '←'
param: bool $current_page Include the current item
param: bool $root Include the root page if one exists
since: 2.0.0 bbPress (r2589)

bbp_breadcrumb( $args = array()   X-Ref
Output a breadcrumb

param: string $sep Separator. Defaults to '←'
param: bool $current_page Include the current item
param: bool $root Include the root page if one exists
since: 2.0.0 bbPress (r2589)

bbp_get_breadcrumb( $args = array()   X-Ref
Return a breadcrumb ( forum -> topic -> reply )

param: string $sep Separator. Defaults to '←'
param: bool $current_page Include the current item
param: bool $root Include the root page if one exists
since: 2.0.0 bbPress (r2589)
return: string Breadcrumbs

bbp_allowed_tags()   X-Ref
Output all of the allowed tags in HTML format with attributes.

This is useful for displaying in the post area, which elements and
attributes are supported. As well as any plugins which want to display it.

since: 2.0.0 bbPress (r2780)

bbp_get_allowed_tags()   X-Ref
Display all of the allowed tags in HTML format with attributes.

This is useful for displaying in the post area, which elements and
attributes are supported. As well as any plugins which want to display it.

since: 2.0.0 bbPress (r2780)
return: string HTML allowed tags entity encoded.

bbp_template_notices()   X-Ref
Display possible errors & messages inside a template file

since: 2.0.0 bbPress (r2688)

bbp_logout_link( $redirect_to = '' )   X-Ref
Output the logout link

param: string $redirect_to Redirect to url
since: 2.0.0 bbPress (r2827)

bbp_get_logout_link( $redirect_to = '' )   X-Ref
Return the logout link

param: string $redirect_to Redirect to url
since: 2.0.0 bbPress (r2827)
return: string The logout link

bbp_title( $title = '', $sep = '»', $seplocation = '' )   X-Ref
Custom page title for bbPress pages

param: string $title Optional. The title (not used).
param: string $sep Optional, default is '»'. How to separate the
param: string $seplocation Optional. Direction to display title, 'right'.
since: 2.0.0 bbPress (r2788)
return: string The title



Generated: Tue Mar 19 01:01:02 2024 Cross-referenced by PHPXref 0.7.1