Skip to:
Content

BuddyPress.org

Changeset 9271


Ignore:
Timestamp:
12/24/2014 02:31:20 AM (5 years ago)
Author:
tw2113
Message:

Add hook documentation in bp-members-screens.php.

Props tw2113.
See #5944.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/bp-members-screens.php

    r9203 r9271  
    1717 */
    1818function bp_members_screen_display_profile() {
     19
     20    /**
     21     * Fires right before the loading of the Member profile screen template file.
     22     *
     23     * @since BuddyPress (1.5.0)
     24     */
    1925    do_action( 'bp_members_screen_display_profile' );
     26
     27    /**
     28     * Filters the template to load for the Member profile page screen.
     29     *
     30     * @since BuddyPress (1.5.0)
     31     *
     32     * @param string $template Path to the Member template to load.
     33     */
    2034    bp_core_load_template( apply_filters( 'bp_members_screen_display_profile', 'members/single/home' ) );
    2135}
     
    2842        bp_update_is_directory( true, 'members' );
    2943
     44        /**
     45         * Fires right before the loading of the Member directory index screen template file.
     46         *
     47         * @since BuddyPress (1.5.0)
     48         */
    3049        do_action( 'bp_members_screen_index' );
    3150
     51        /**
     52         * Filters the template to load for the Member directory page screen.
     53         *
     54         * @since BuddyPress (1.5.0)
     55         *
     56         * @param string $value Path to the member directory template to load.
     57         */
    3258        bp_core_load_template( apply_filters( 'bp_members_screen_index', 'members/index' ) );
    3359    }
     
    5480            $redirect_to = bp_get_root_domain();
    5581
     82        /**
     83         * Filters the URL to redirect logged in users to when visiting registration page.
     84         *
     85         * @since BuddyPress (1.5.1)
     86         *
     87         * @param string $redirect_to URL to redirect user to.
     88         */
    5689        bp_core_redirect( apply_filters( 'bp_loggedin_register_page_redirect_to', $redirect_to ) );
    5790
     
    67100    } elseif ( isset( $_POST['signup_submit'] ) && bp_verify_nonce_request( 'bp_new_signup' ) ) {
    68101
     102        /**
     103         * Fires before the validation of a new signup.
     104         *
     105         * @since BuddyPress (2.0.0)
     106         */
    69107        do_action( 'bp_signup_pre_validate' );
    70108
     
    133171        }
    134172
     173        /**
     174         * Fires after the validation of a new signup.
     175         *
     176         * @since BuddyPress (1.1.0)
     177         */
    135178        do_action( 'bp_signup_validate' );
    136179
     
    140183                // addslashes() and stripslashes() to avoid create_function()
    141184                // syntax errors when the $error_message contains quotes
     185
     186                /**
     187                 * Filters the error message in the loop.
     188                 *
     189                 * @since BuddyPress (1.5.0)
     190                 *
     191                 * @param string $value Error message wrapped in html.
     192                 */
    142193                add_action( 'bp_' . $fieldname . '_errors', create_function( '', 'echo apply_filters(\'bp_members_signup_error_message\', "<div class=\"error\">" . stripslashes( \'' . addslashes( $error_message ) . '\' ) . "</div>" );' ) );
    143194            }
     
    186237                    $usermeta['public'] = ( isset( $_POST['signup_blog_privacy'] ) && 'public' == $_POST['signup_blog_privacy'] ) ? true : false;
    187238
     239                /**
     240                 * Filters the user meta used for signup.
     241                 *
     242                 * @since BuddyPress (1.1.0)
     243                 *
     244                 * @param array $usermeta Array of user meta to add to signup.
     245                 */
    188246                $usermeta = apply_filters( 'bp_signup_usermeta', $usermeta );
    189247
     
    202260            }
    203261
     262            /**
     263             * Fires after the completion of a new signup.
     264             *
     265             * @since BuddyPress (1.1.0)
     266             */
    204267            do_action( 'bp_complete_signup' );
    205268        }
     
    207270    }
    208271
     272    /**
     273     * Fires right before the loading of the Member registration screen template file.
     274     *
     275     * @since BuddyPress (1.5.0)
     276     */
    209277    do_action( 'bp_core_screen_signup' );
     278
     279    /**
     280     * Filters the template to load for the Member registration page screen.
     281     *
     282     * @since BuddyPress (1.5.0)
     283     *
     284     * @param string $value Path to the Member registration template to load.
     285     */
    210286    bp_core_load_template( apply_filters( 'bp_core_template_register', array( 'register', 'registration/register' ) ) );
    211287}
     
    229305        }
    230306
     307        /**
     308         * Filters the URL to redirect logged in users to when visiting activation page.
     309         *
     310         * @since BuddyPress (1.9.0)
     311         *
     312         * @param string $redirect_to URL to redirect user to.
     313         */
    231314        bp_core_redirect( apply_filters( 'bp_loggedin_activate_page_redirect_to', $redirect_to ) );
    232315
     
    244327    // we've got a key; let's attempt to activate the signup
    245328    if ( ! empty( $key ) ) {
    246         // Activate the signup
     329
     330        /**
     331         * Filters the activation signup.
     332         *
     333         * @since BuddyPress (1.1.0)
     334         *
     335         * @param bool|int $value Value returned by activation.
     336         *                        Integer on success, boolean on failure.
     337         */
    247338        $user = apply_filters( 'bp_core_activate_account', bp_core_activate_signup( $key ) );
    248339
     
    265356    }
    266357
     358    /**
     359     * Filters the template to load for the Member activation page screen.
     360     *
     361     * @since BuddyPress (1.1.1)
     362     *
     363     * @param string $value Path to the Member activation template to load.
     364     */
    267365    bp_core_load_template( apply_filters( 'bp_core_template_activate', array( 'activate', 'registration/activate' ) ) );
    268366}
     
    305403            bp_update_is_directory( true, 'members' );
    306404
     405            /**
     406             * Fires if looking at Members directory when needing theme compat.
     407             *
     408             * @since BuddyPress (1.5.0)
     409             */
    307410            do_action( 'bp_members_screen_index' );
    308411
     
    318421                return;
    319422
     423            /**
     424             * Fires if looking at Members user page when needing theme compat.
     425             *
     426             * @since BuddyPress (1.5.0)
     427             */
    320428            do_action( 'bp_members_screen_display_profile' );
    321429
     
    337445     * @since BuddyPress (1.8.0)
    338446     *
    339      * @param string $templates The templates from bp_get_theme_compat_templates().
     447     * @param array $templates The templates from bp_get_theme_compat_templates().
     448     *
    340449     * @return array $templates Array of custom templates to look for.
    341450     */
    342451    public function directory_template_hierarchy( $templates = array() ) {
    343452
    344         // Setup our templates based on priority
     453        /**
     454         * Filters the template hierarchy for theme compat and members directory page.
     455         *
     456         * @since BuddyPress (1.8.0)
     457         *
     458         * @param array $value Array of template paths to add to hierarchy.
     459         */
    345460        $new_templates = apply_filters( 'bp_template_hierarchy_members_directory', array(
    346461            'members/index-directory.php'
     
    400515        $user_nicename = buddypress()->displayed_user->userdata->user_nicename;
    401516
    402         // Setup our templates based on priority
     517        /**
     518         * Filters the template hierarchy for theme compat and member pages.
     519         *
     520         * @since BuddyPress (1.8.0)
     521         *
     522         * @param array $value Array of template paths to add to hierarchy.
     523         */
    403524        $new_templates = apply_filters( 'bp_template_hierarchy_members_single_item', array(
    404525            'members/single/index-id-'        . sanitize_file_name( bp_displayed_user_id() ) . '.php',
     
    502623        $component = sanitize_file_name( bp_current_component() );
    503624
    504         // Setup our templates based on priority
     625        /**
     626         * Filters the template hierarchy for theme compat and registration/activation pages.
     627         *
     628         * This filter is a variable filter that depends on the current component
     629         * being used.
     630         *
     631         * @since BuddyPress (1.8.0)
     632         *
     633         * @param array $value Array of template paths to add to hierarchy.
     634         */
    505635        $new_templates = apply_filters( "bp_template_hierarchy_{$component}", array(
    506636            "members/index-{$component}.php"
Note: See TracChangeset for help on using the changeset viewer.