Skip to:
Content

BuddyPress.org

Changeset 12529


Ignore:
Timestamp:
01/18/2020 12:44:17 PM (5 years ago)
Author:
imath
Message:

xProfile: fix PHP Code standards in inline comments

Props passoniate

Fixes #8215
Fixes #8216

Location:
trunk/src/bp-xprofile
Files:
7 edited

Legend:

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

    r11808 r12529  
    4646        : false;
    4747
    48     // Group ID
     48    // Group ID.
    4949    $group_id = ! empty( $_GET['group_id'] )
    5050        ? intval( $_GET['group_id'] )
    5151        : false;
    5252
    53     // Field ID
     53    // Field ID.
    5454    $field_id = ! empty( $_GET['field_id'] )
    5555        ? intval( $_GET['field_id'] )
    5656        : false;
    5757
    58     // Option ID
     58    // Option ID.
    5959    $option_id = ! empty( $_GET['option_id'] )
    6060        ? intval( $_GET['option_id'] )
    6161        : false;
    6262
    63     // Allowed modes
     63    // Allowed modes.
    6464    $allowed_modes = array(
    6565        'add_group',
     
    7272    );
    7373
    74     // Is an allowed mode
     74    // Is an allowed mode.
    7575    if ( in_array( $mode, $allowed_modes, true ) ) {
    7676
    77         // All group actions
     77        // All group actions.
    7878        if ( false !== $group_id ) {
    7979
    80             // Add field to group
     80            // Add field to group.
    8181            if ( 'add_field' == $mode ) {
    8282                xprofile_admin_manage_field( $group_id );
    8383
    84             // Edit field of group
     84            // Edit field of group.
    8585            } elseif ( ! empty( $field_id ) && 'edit_field' === $mode ) {
    8686                xprofile_admin_manage_field( $group_id, $field_id );
    8787
    88             // Delete group
     88            // Delete group.
    8989            } elseif ( 'delete_group' === $mode ) {
    9090                xprofile_admin_delete_group( $group_id );
    9191
    92             // Edit group
     92            // Edit group.
    9393            } elseif ( 'edit_group' === $mode ) {
    9494                xprofile_admin_manage_group( $group_id );
    9595            }
    9696
    97         // Delete field
     97        // Delete field.
    9898        } elseif ( ( false !== $field_id ) && ( 'delete_field' === $mode ) ) {
    9999            xprofile_admin_delete_field( $field_id, 'field');
    100100
    101         // Delete option
     101        // Delete option.
    102102        } elseif ( ! empty( $option_id ) && 'delete_option' === $mode ) {
    103103            xprofile_admin_delete_field( $option_id, 'option' );
    104104
    105         // Add group
     105        // Add group.
    106106        } elseif ( 'add_group' == $mode ) {
    107107            xprofile_admin_manage_group();
     
    125125function xprofile_admin_screen( $message = '', $type = 'error' ) {
    126126
    127     // Users admin URL
     127    // Users admin URL.
    128128    $url = bp_get_admin_url( 'users.php' );
    129129
    130     // Add Group
     130    // Add Group.
    131131    $add_group_url = add_query_arg( array(
    132132        'page' => 'bp-profile-setup',
     
    201201                <?php if ( !empty( $groups ) ) : foreach ( $groups as $group ) :
    202202
    203                     // Add Field to Group URL
     203                    // Add Field to Group URL.
    204204                    $add_field_url = add_query_arg( array(
    205205                        'page'     => 'bp-profile-setup',
     
    208208                    ), $url );
    209209
    210                     // Edit Group URL
     210                    // Edit Group URL.
    211211                    $edit_group_url = add_query_arg( array(
    212212                        'page'     => 'bp-profile-setup',
     
    215215                    ), $url );
    216216
    217                     // Delete Group URL
     217                    // Delete Group URL.
    218218                    $delete_group_url = wp_nonce_url( add_query_arg( array(
    219219                        'page'     => 'bp-profile-setup',
     
    341341    if ( isset( $_POST['save_group'] ) ) {
    342342
    343         // Check nonce
     343        // Check nonce.
    344344        check_admin_referer( 'bp_xprofile_admin_group', 'bp_xprofile_admin_group' );
    345345
     
    367367                $type    = 'success';
    368368
    369                 // @todo remove these old options
     369                // @todo remove these old options.
    370370                if ( 1 == $group_id ) {
    371371                    bp_update_option( 'bp-xprofile-base-group-name', $group->name );
     
    449449    if ( isset( $_POST['saveField'] ) ) {
    450450
    451         // Check nonce
     451        // Check nonce.
    452452        check_admin_referer( 'bp_xprofile_admin_field', 'bp_xprofile_admin_field' );
    453453
     
    484484                $type    = 'success';
    485485
    486                 // @todo remove these old options
     486                // @todo remove these old options.
    487487                if ( 1 == $field_id ) {
    488488                    bp_update_option( 'bp-xprofile-fullname-field-name', $field->name );
     
    650650    $field = $admin_field;
    651651
    652     // Users admin URL
     652    // Users admin URL.
    653653    $url = bp_get_admin_url( 'users.php' );
    654654
    655     // Edit
     655    // Edit.
    656656    $field_edit_url = add_query_arg( array(
    657657        'page'     => 'bp-profile-setup',
     
    661661    ), $url );
    662662
    663     // Delete
     663    // Delete.
    664664    if ( $field->can_delete ) {
    665665        $field_delete_url = add_query_arg( array(
  • trunk/src/bp-xprofile/bp-xprofile-cache.php

    r12317 r12529  
    181181 * @since 2.1.0
    182182 *
    183  * @param object $group_obj Groub object to clear.
     183 * @param object $group_obj Group object to clear.
    184184 */
    185185function xprofile_clear_profile_groups_object_cache( $group_obj ) {
  • trunk/src/bp-xprofile/bp-xprofile-filters.php

    r12416 r12529  
    194194 * @since 1.2.6
    195195 *
    196  * @param string      $field_value Field value being santized.
     196 * @param string      $field_value Field value being sanitized.
    197197 * @param int         $field_id    Field ID being sanitized.
    198198 * @param bool        $reserialize Whether to reserialize arrays before returning. Defaults to true.
     
    409409         * Before splitting on the ";" character, decode the HTML entities, and re-encode after.
    410410         * This prevents input like "O'Hara" rendering as "O&#039; Hara" (with each of those parts
    411          * having a seperate HTML link).
     411         * having a separate HTML link).
    412412         */
    413413        $list_type   = 'semicolon';
  • trunk/src/bp-xprofile/bp-xprofile-functions.php

    r12110 r12529  
    480480 * @param int    $field_id         The ID of the xprofile field.
    481481 * @param int    $user_id          The ID of the user to whom the data belongs.
    482  * @param string $visibility_level What the visibity setting should be.
     482 * @param string $visibility_level What the visibility setting should be.
    483483 * @return bool True on success
    484484 */
     
    13431343 * @since 4.0.0
    13441344 *
    1345  * @param string $email_address  The userss email address.
     1345 * @param string $email_address  The users email address.
    13461346 * @return array An array of personal data.
    13471347 */
  • trunk/src/bp-xprofile/bp-xprofile-template.php

    r12515 r12529  
    594594        global $field;
    595595
    596         // Make sure field data object exists
     596        // Make sure field data object exists.
    597597        if ( ! isset( $field->data ) ) {
    598598            $field->data = new stdClass;
    599599        }
    600600
    601         // Default to empty value
     601        // Default to empty value.
    602602        if ( ! isset( $field->data->value ) ) {
    603603            $field->data->value = '';
     
    607607        if ( isset( $_POST['field_' . $field->id] ) ) {
    608608
    609             // This is sanitized via the filter below (based on the field type)
     609            // This is sanitized via the filter below (based on the field type).
    610610            $field->data->value = $_POST['field_' . $field->id];
    611611        }
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-field-type.php

    r11834 r12529  
    492492
    493493    /**
    494      * Get a sanitised and escaped string of the edit field's HTML elements and attributes.
     494     * Get a sanitized and escaped string of the edit field's HTML elements and attributes.
    495495     *
    496496     * Must be used inside the {@link bp_profile_fields()} template loop.
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-field.php

    r12317 r12529  
    178178            $this->populate( $id, $user_id, $get_data );
    179179
    180         // Initialise the type obj to prevent fatals when creating new profile fields.
     180        // Initialize the type obj to prevent fatals when creating new profile fields.
    181181        } else {
    182182            $this->type_obj            = bp_xprofile_create_field_type( 'textbox' );
     
    640640            }
    641641
    642             // If no member types have been saved, intepret as *all* member types.
     642            // If no member types have been saved, interpret as *all* member types.
    643643            if ( empty( $types ) ) {
    644644                $types = array_values( $registered_types );
     
    10731073
    10741074    /**
    1075      * Validate form field data on sumbission.
     1075     * Validate form field data on submission.
    10761076     *
    10771077     * @since 2.2.0
     
    11081108        }
    11091109
    1110         // Get field type so we can check for and lavidate any field options.
     1110        // Get field type so we can check for and validate any field options.
    11111111        $field_type = bp_xprofile_create_field_type( $_POST['fieldtype'] );
    11121112
     
    11761176    public function render_admin_form( $message = '' ) {
    11771177
    1178         // Users Admin URL
     1178        // Users Admin URL.
    11791179        $users_url = bp_get_admin_url( 'users.php' );
    11801180
    1181         // Add New
     1181        // Add New.
    11821182        if ( empty( $this->id ) ) {
    11831183            $title  = __( 'Add New Field', 'buddypress' );
     
    12011201            }
    12021202
    1203         // Edit
     1203        // Edit.
    12041204        } else {
    12051205            $title  = __( 'Edit Field', 'buddypress' );
     
    16141614    private function default_field_hidden_inputs() {
    16151615
    1616         // Nonce
     1616        // Nonce.
    16171617        wp_nonce_field( 'bp_xprofile_admin_field', 'bp_xprofile_admin_field' );
    16181618
Note: See TracChangeset for help on using the changeset viewer.