Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/19/2013 06:41:17 PM (11 years ago)
Author:
boonebgorges
Message:

Improve inline docs in bp-core. See #5022

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-dependency.php

    r7367 r7446  
    22
    33/**
    4  * Plugin Dependency
     4 * Plugin Dependency Action Hooks.
    55 *
    66 * The purpose of the following hooks is to mimic the behavior of something
     
    88 * own in a safe and reliable way.
    99 *
    10  * We do this in BuddyPress by mirroring existing WordPress hookss in many places
     10 * We do this in BuddyPress by mirroring existing WordPress hooks in many places
    1111 * allowing dependant plugins to hook into the BuddyPress specific ones, thus
    1212 * guaranteeing proper code execution only when BuddyPress is active.
    1313 *
    14  * The following functions are wrappers for hookss, allowing them to be
     14 * The following functions are wrappers for hooks, allowing them to be
    1515 * manually called and/or piggy-backed on top of other hooks if needed.
    1616 *
     
    1919
    2020/**
    21  * Include files on this action
     21 * Fire the 'bp_include' action, where plugins should include files.
    2222 */
    2323function bp_include() {
     
    2626
    2727/**
    28  * Include files on this action
     28 * Fire the 'bp_setup_components' action, where plugins should initialize components.
    2929 */
    3030function bp_setup_components() {
     
    3333
    3434/**
    35  * Setup global variables and objects
     35 * Fire the 'bp_setup_globals' action, where plugins should initialize global settings.
    3636 */
    3737function bp_setup_globals() {
     
    4040
    4141/**
    42  * Set navigation elements
     42 * Fire the 'bp_setup_nav' action, where plugins should register their navigation items.
    4343 */
    4444function bp_setup_nav() {
     
    4747
    4848/**
    49  * Set up BuddyPress implementation of the WP Toolbar
     49 * Fire the 'bp_setup_admin_bar' action, where plugins should add items to the WP admin bar.
    5050 */
    5151function bp_setup_admin_bar() {
     
    5555
    5656/**
    57  * Set the page title
     57 * Fire the 'bp_setup_title' action, where plugins should modify the page title.
    5858 */
    5959function bp_setup_title() {
     
    6262
    6363/**
    64  * Register widgets
     64 * Fire the 'bp_register_widgets' action, where plugins should register widgets.
    6565 */
    6666function bp_setup_widgets() {
     
    6969
    7070/**
    71  * Setup the currently logged-in user
    72  *
    73  * @uses did_action() To make sure the user isn't loaded out of order
    74  * @uses do_action() Calls 'bp_setup_current_user'
     71 * Set up the currently logged-in user.
     72 *
     73 * @uses did_action() To make sure the user isn't loaded out of order.
     74 * @uses do_action() Calls 'bp_setup_current_user'.
    7575 */
    7676function bp_setup_current_user() {
     
    8686
    8787/**
    88  * Initlialize code
     88 * Fire the 'bp_init' action, BuddyPress's main initialization hook.
    8989 */
    9090function bp_init() {
     
    9393
    9494/**
    95  * Attached to plugins_loaded
     95 * Fire the 'bp_loaded' action, which fires after BP's core plugin files have been loaded.
     96 *
     97 * Attached to 'plugins_loaded'.
    9698 */
    9799function bp_loaded() {
     
    100102
    101103/**
    102  * Attached to wp
     104 * Fire the 'bp_ready' action, which runs after BP is set up and the page is about to render.
     105 *
     106 * Attached to 'wp'.
    103107 */
    104108function bp_ready() {
     
    107111
    108112/**
    109  * Attach potential template actions
     113 * Fire the 'bp_actions' action, which runs just before rendering.
     114 *
     115 * Attach potential template actions, such as catching form requests or routing
     116 * custom URLs.
    110117 */
    111118function bp_actions() {
     
    114121
    115122/**
    116  * Attach potential template screens
     123 * Fire the 'bp_screens' action, which runs just before rendering.
     124 *
     125 * Runs just after 'bp_actions'. Use this hook to attach your template
     126 * loaders.
    117127 */
    118128function bp_screens() {
     
    121131
    122132/**
    123  * Initialize widgets
     133 * Fire 'bp_widgets_init', which runs after widgets have been set up.
     134 *
     135 * Hooked to 'widgets_init'.
    124136 */
    125137function bp_widgets_init() {
     
    128140
    129141/**
    130  * BuddyPress head scripts
     142 * Fire 'bp_head', which is used to hook scripts and styles in the <head>.
     143 *
     144 * Hooked to 'wp_head'.
    131145 */
    132146function bp_head() {
     
    137151
    138152/**
    139  * The main action used for redirecting BuddyPress theme actions that are not
    140  * permitted by the current_user
    141  *
    142  * @since BuddyPress (1.6)
     153 * Fire the 'bp_template_redirect' action.
     154 *
     155 * Run at 'template_redirect', just before WordPress selects and loads a theme
     156 * template. The main purpose of this hook in BuddyPress is to redirect users
     157 * who do not have the proper permission to access certain content.
     158 *
     159 * @since BuddyPress (1.6.0)
    143160 *
    144161 * @uses do_action()
     
    151168
    152169/**
    153  * The main action used registering theme directory
    154  *
    155  * @since BuddyPress (1.5)
     170 * Fire the 'bp_register_theme_directory' action.
     171 *
     172 * The main action used registering theme directories.
     173 *
     174 * @since BuddyPress (1.5.0)
     175 *
    156176 * @uses do_action()
    157177 */
     
    161181
    162182/**
    163  * The main action used registering theme packages
    164  *
    165  * @since BuddyPress (1.7)
     183 * Fire the 'bp_register_theme_packages' action.
     184 *
     185 * The main action used registering theme packages.
     186 *
     187 * @since BuddyPress (1.7.0)
     188 *
    166189 * @uses do_action()
    167190 */
     
    171194
    172195/**
    173  * Enqueue BuddyPress specific CSS and JS
    174  *
    175  * @since BuddyPress (1.6)
    176  *
    177  * @uses do_action() Calls 'bp_enqueue_scripts'
     196 * Fire the 'bp_enqueue_scripts' action, where BP enqueues its CSS and JS.
     197 *
     198 * @since BuddyPress (1.6.0)
     199 *
     200 * @uses do_action() Calls 'bp_enqueue_scripts'.
    178201 */
    179202function bp_enqueue_scripts() {
     
    182205
    183206/**
    184  * Add the BuddyPress-specific rewrite tags
    185  *
    186  * @since BuddyPress (1.8)
    187  * @uses do_action() Calls 'bp_add_rewrite_tags'
     207 * Fire the 'bp_add_rewrite_tag' action, where BP adds its custom rewrite tags.
     208 *
     209 * @since BuddyPress (1.8.0)
     210 *
     211 * @uses do_action() Calls 'bp_add_rewrite_tags'.
    188212 */
    189213function bp_add_rewrite_tags() {
     
    192216
    193217/**
    194  * Add the BuddyPress-specific rewrite rules
    195  *
    196  * @since BuddyPress (1.9)
    197  * @uses do_action() Calls 'bp_add_rewrite_rules'
     218 * Fire the 'bp_add_rewrite_rules' action, where BP adds its custom rewrite rules.
     219 *
     220 * @since BuddyPress (1.9.0)
     221 *
     222 * @uses do_action() Calls 'bp_add_rewrite_rules'.
    198223 */
    199224function bp_add_rewrite_rules() {
     
    202227
    203228/**
    204  * Add the BuddyPress-specific permalink structures
    205  *
    206  * @since BuddyPress (1.9)
    207  * @uses do_action() Calls 'bp_add_permastructs'
     229 * Fire the 'bp_add_permastructs' action, where BP adds its BP-specific permalink structure.
     230 *
     231 * @since BuddyPress (1.9.0)
     232 *
     233 * @uses do_action() Calls 'bp_add_permastructs'.
    208234 */
    209235function bp_add_permastructs() {
     
    212238
    213239/**
    214  * Piggy back action for BuddyPress sepecific theme actions before the theme has
    215  * been setup and the theme's functions.php has loaded.
    216  *
    217  * @since BuddyPress (1.6)
    218  *
    219  * @uses do_action() Calls 'bp_setup_theme'
     240 * Fire the 'bp_setup_theme' action.
     241 *
     242 * The main purpose of 'bp_setup_theme' is give themes a place to load their
     243 * BuddyPress-specific functionality.
     244 *
     245 * @since BuddyPress (1.6.0)
     246 *
     247 * @uses do_action() Calls 'bp_setup_theme'.
    220248 */
    221249function bp_setup_theme() {
     
    224252
    225253/**
    226  * Piggy back action for BuddyPress sepecific theme actions once the theme has
    227  * been setup and the theme's functions.php has loaded.
     254 * Fire the 'bp_after_setup_theme' action.
     255 *
     256 * Piggy-back action for BuddyPress-specific theme actions once the theme has
     257 * been set up and the theme's functions.php has loaded.
    228258 *
    229259 * Hooked to 'after_setup_theme' with a priority of 100. This allows plenty of
     
    231261 * before our theme compatibility layer kicks in.
    232262 *
    233  * @since BuddyPress (1.6)
    234  *
    235  * @uses do_action() Calls 'bp_after_setup_theme'
     263 * @since BuddyPress (1.6.0)
     264 *
     265 * @uses do_action() Calls 'bp_after_setup_theme'.
    236266 */
    237267function bp_after_setup_theme() {
     
    242272
    243273/**
    244  * Piggy back filter for WordPress's 'request' filter
    245  *
    246  * @since BuddyPress (1.7)
    247  * @param array $query_vars
    248  * @return array
     274 * Fire the 'bp_request' filter, a piggy-back of WP's 'request'.
     275 *
     276 * @since BuddyPress (1.7.0)
     277 *
     278 * @see WP::parse_request() for a description of parameters.
     279 *
     280 * @param array $query_vars See {@link WP::parse_request()}.
     281 * @return array $query_vars See {@link WP::parse_request()}.
    249282 */
    250283function bp_request( $query_vars = array() ) {
     
    253286
    254287/**
    255  * Piggy back filter to handle login redirects.
    256  *
    257  * @since BuddyPress (1.7)
    258  *
    259  * @param string $redirect_to
    260  * @param string $redirect_to_raw
    261  * @param string $user
     288 * Fire the 'bp_login_redirect' filter, a piggy-back of WP's 'login_redirect'.
     289 *
     290 * @since BuddyPress (1.7.0)
     291 *
     292 * @param string $redirect_to See 'login_redirect'.
     293 * @param string $redirect_to_raw See 'login_redirect'.
     294 * @param string $user See 'login_redirect'.
    262295 */
    263296function bp_login_redirect( $redirect_to = '', $redirect_to_raw = '', $user = false ) {
     
    266299
    267300/**
    268  * The main filter used for theme compatibility and displaying custom BuddyPress
    269  * theme files.
    270  *
    271  * @since BuddyPress (1.6)
     301 * Fire 'bp_template_include', main filter used for theme compatibility and displaying custom BP theme files.
     302 *
     303 * Hooked to 'template_include'.
     304 *
     305 * @since BuddyPress (1.6.0)
    272306 *
    273307 * @uses apply_filters()
    274308 *
    275  * @param string $template
    276  * @return string Template file to use
     309 * @param string $template See 'template_include'.
     310 * @return string Template file to use.
    277311 */
    278312function bp_template_include( $template = '' ) {
     
    281315
    282316/**
    283  * Generate BuddyPress-specific rewrite rules
    284  *
    285  * @since BuddyPress (1.7)
    286  * @param WP_Rewrite $wp_rewrite
    287  * @uses do_action() Calls 'bp_generate_rewrite_rules' with {@link WP_Rewrite}
     317 * Fire the 'bp_generate_rewrite_rules' filter, where BP generates its rewrite rules.
     318 *
     319 * @since BuddyPress (1.7.0)
     320 *
     321 * @uses do_action() Calls 'bp_generate_rewrite_rules' with {@link WP_Rewrite}.
     322 *
     323 * @param WP_Rewrite $wp_rewrite See 'generate_rewrite_rules'.
    288324 */
    289325function bp_generate_rewrite_rules( $wp_rewrite ) {
     
    292328
    293329/**
    294  * Filter the allowed themes list for BuddyPress specific themes
    295  *
    296  * @since BuddyPress (1.7)
    297  * @uses apply_filters() Calls 'bp_allowed_themes' with the allowed themes list
     330 * Fire the 'bp_allowed_themes' filter.
     331 *
     332 * Filter the allowed themes list for BuddyPress-specific themes.
     333 *
     334 * @since BuddyPress (1.7.0)
     335 *
     336 * @uses apply_filters() Calls 'bp_allowed_themes' with the allowed themes list.
    298337 */
    299338function bp_allowed_themes( $themes ) {
Note: See TracChangeset for help on using the changeset viewer.