[ 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

since: 2.0.0 bbPress (r2926)
return: array Body Classes
param: array $wp_classes
param: array $custom_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.

since: 2.6.0
return: bool
param: string $text

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

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

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

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

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().

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

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.

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

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.

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

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.

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

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.

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

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.

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

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.

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

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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

since: 2.0.0 bbPress (r2788)
return: string The title
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'.



Generated: Sat Dec 21 01:00:52 2024 Cross-referenced by PHPXref 0.7.1