Skip to:
Content

BuddyPress.org

Changeset 9290


Ignore:
Timestamp:
12/29/2014 10:28:28 PM (12 years ago)
Author:
tw2113
Message:

Add hooks docs to bp-xprofile-screens.php.

See #5949.

File:
1 edited

Legend:

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

    r9190 r9290  
    2424        $new = isset( $_GET['new'] ) ? $_GET['new'] : '';
    2525
     26        /**
     27         * Fires right before the loading of the XProfile screen template file.
     28         *
     29         * @since BuddyPress (1.0.0)
     30         *
     31         * @param string $new $_GET parameter holding the "new" parameter.
     32         */
    2633        do_action( 'xprofile_screen_display_profile', $new );
     34
     35        /**
     36         * Filters the template to load for the XProfile screen.
     37         *
     38         * @since BuddyPress (1.0.0)
     39         *
     40         * @param string $template Path to the XProfile template to load.
     41         */
    2742        bp_core_load_template( apply_filters( 'xprofile_template_display_profile', 'members/single/home' ) );
    2843}
     
    132147                                        $errors = true;
    133148                                } else {
     149
     150                                        /**
     151                                         * Fires on each iteration of an XProfile field being saved with no error.
     152                                         *
     153                                         * @since BuddyPress (1.1.0)
     154                                         *
     155                                         * @param int    $field_id ID of the field that was saved.
     156                                         * @param string $value    Value that was saved to the field.
     157                                         */
    134158                                        do_action( 'xprofile_profile_field_data_updated', $field_id, $value );
    135159                                }
    136160                        }
    137161
     162                        /**
     163                         * Fires after all XProfile fields have been saved for the current profile.
     164                         *
     165                         * @since BuddyPress (1.0.0)
     166                         *
     167                         * @param int   $value            Displayed user ID.
     168                         * @param array $posted_field_ids Array of field IDs that were edited.
     169                         * @param bool  $errors           Whether or not any errors occurred.
     170                         * @param array $old_values       Array of original values before updated.
     171                         * @param array $new_values       Array of newly saved values after update.
     172                         */
    138173                        do_action( 'xprofile_updated_profile', bp_displayed_user_id(), $posted_field_ids, $errors, $old_values, $new_values );
    139174
     
    150185        }
    151186
     187        /**
     188         * Fires right before the loading of the XProfile edit screen template file.
     189         *
     190         * @since BuddyPress (1.0.0)
     191         */
    152192        do_action( 'xprofile_screen_edit_profile' );
     193
     194        /**
     195         * Filters the template to load for the XProfile edit screen.
     196         *
     197         * @since BuddyPress (1.0.0)
     198         *
     199         * @param string $template Path to the XProfile edit template to load.
     200         */
    153201        bp_core_load_template( apply_filters( 'xprofile_template_edit_profile', 'members/single/home' ) );
    154202}
     
    212260                        bp_core_add_message( __( 'There was a problem cropping your profile photo.', 'buddypress' ), 'error' );
    213261                } else {
     262
     263                        /**
     264                         * Fires right before the redirect, after processing a new avatar.
     265                         *
     266                         * @since BuddyPress (1.1.0)
     267                         */
    214268                        do_action( 'xprofile_avatar_uploaded' );
    215269                        bp_core_add_message( __( 'Your new profile photo was uploaded successfully.', 'buddypress' ) );
     
    218272        }
    219273
     274        /**
     275         * Fires right before the loading of the XProfile change avatar screen template file.
     276         *
     277         * @since BuddyPress (1.0.0)
     278         */
    220279        do_action( 'xprofile_screen_change_avatar' );
    221280
     281        /**
     282         * Filters the template to load for the XProfile change avatar screen.
     283         *
     284         * @since BuddyPress (1.0.0)
     285         *
     286         * @param string $template Path to the XProfile change avatar template to load.
     287         */
    222288        bp_core_load_template( apply_filters( 'xprofile_template_change_avatar', 'members/single/home' ) );
    223289}
     
    236302        }
    237303
    238         // Load the template
     304        /**
     305         * Filters the template to load for the XProfile settings screen.
     306         *
     307         * @since BuddyPress (2.0.0)
     308         *
     309         * @param string $template Path to the XProfile change avatar template to load.
     310         */
    239311        bp_core_load_template( apply_filters( 'bp_settings_screen_xprofile', '/members/single/settings/profile' ) );
    240312}
Note: See TracChangeset for help on using the changeset viewer.