Skip to:
Content

BuddyPress.org

Changeset 13393


Ignore:
Timestamp:
01/06/2023 11:51:53 PM (2 years ago)
Author:
espellcaste
Message:

PHPCS: adding space after an operator in a if statement.

Closes https://github.com/buddypress/buddypress/pull/45
See #7228

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

Legend:

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

    r12886 r13393  
    122122
    123123function hide( id ) {
    124     if ( !document.getElementById( id ) ) {
     124    if ( ! document.getElementById( id ) ) {
    125125        return false;
    126126    }
  • trunk/src/bp-xprofile/bp-xprofile-admin.php

    r13392 r13393  
    171171                <ul id="field-group-tabs">
    172172
    173                     <?php if ( !empty( $groups ) ) : foreach ( $groups as $group ) : ?>
     173                    <?php if ( ! empty( $groups ) ) : foreach ( $groups as $group ) : ?>
    174174
    175175                        <li id="group_<?php echo esc_attr( $group->id ); ?>">
     
    180180                                ?>
    181181
    182                                 <?php if ( !$group->can_delete ) : ?>
     182                                <?php if ( ! $group->can_delete ) : ?>
    183183                                    <?php _e( '(Primary)', 'buddypress'); ?>
    184184                                <?php endif; ?>
     
    197197                </ul>
    198198
    199                 <?php if ( !empty( $groups ) ) : foreach ( $groups as $group ) :
     199                <?php if ( ! empty( $groups ) ) : foreach ( $groups as $group ) :
    200200
    201201                    // Add Field to Group URL.
     
    274274                            <?php
    275275
    276                             if ( !empty( $group->fields ) ) :
     276                            if ( ! empty( $group->fields ) ) :
    277277                                foreach ( $group->fields as $field ) {
    278278
     
    746746        $field = xprofile_get_field( $field_id, null, false );
    747747
    748         if ( !$field->delete( (bool) $delete_data ) ) {
     748        if ( ! $field->delete( (bool) $delete_data ) ) {
    749749            /* translators: %s: the field type */
    750750            $message = sprintf( __( 'There was an error deleting the %s. Please try again.', 'buddypress' ), $field_type );
     
    10451045    ?>
    10461046
    1047     <fieldset id="<?php echo esc_attr( $fieldset_id ); ?>" class="sortable<?php echo ' ' . $field->type; if ( !empty( $class ) ) echo ' ' . $class; ?>">
     1047    <fieldset id="<?php echo esc_attr( $fieldset_id ); ?>" class="sortable<?php echo ' ' . $field->type; if ( ! empty( $class ) ) echo ' ' . $class; ?>">
    10481048        <legend>
    10491049            <span>
  • trunk/src/bp-xprofile/bp-xprofile-caps.php

    r12768 r13393  
    5151
    5252            // Friends don't let friends edit each other's visibility.
    53             if ( $profile_user_id != bp_displayed_user_id() && !bp_current_user_can( 'bp_moderate' ) ) {
     53            if ( $profile_user_id != bp_displayed_user_id() && ! bp_current_user_can( 'bp_moderate' ) ) {
    5454                $caps[] = 'do_not_allow';
    5555                break;
  • trunk/src/bp-xprofile/bp-xprofile-cssjs.php

    r13392 r13393  
    1717 */
    1818function xprofile_add_admin_css() {
    19     if ( !empty( $_GET['page'] ) && strpos( $_GET['page'], 'bp-profile-setup' ) !== false ) {
     19    if ( ! empty( $_GET['page'] ) && strpos( $_GET['page'], 'bp-profile-setup' ) !== false ) {
    2020        $min = bp_core_get_minified_asset_suffix();
    2121
     
    3636 */
    3737function xprofile_add_admin_js() {
    38     if ( !empty( $_GET['page'] ) && strpos( $_GET['page'], 'bp-profile-setup' ) !== false ) {
     38    if ( ! empty( $_GET['page'] ) && strpos( $_GET['page'], 'bp-profile-setup' ) !== false ) {
    3939        wp_enqueue_script( 'jquery-ui-core'      );
    4040        wp_enqueue_script( 'jquery-ui-tabs'      );
  • trunk/src/bp-xprofile/bp-xprofile-filters.php

    r12887 r13393  
    248248        }
    249249
    250         if ( !empty( $reserialize ) ) {
     250        if ( ! empty( $reserialize ) ) {
    251251            $filtered_field_value = serialize( $filtered_values );
    252252        } else {
  • trunk/src/bp-xprofile/bp-xprofile-functions.php

    r13392 r13393  
    547547    // Check against a list of registered visibility levels.
    548548    $allowed_values = bp_xprofile_get_visibility_levels();
    549     if ( !array_key_exists( $visibility_level, $allowed_values ) ) {
     549    if ( ! array_key_exists( $visibility_level, $allowed_values ) ) {
    550550        return false;
    551551    }
     
    554554    $current_visibility_levels = bp_get_user_meta( $user_id, 'bp_xprofile_visibility_levels', true );
    555555
    556     if ( !$current_visibility_levels ) {
     556    if ( ! $current_visibility_levels ) {
    557557        $current_visibility_levels = array();
    558558    }
     
    787787        $search_terms_space   = '%' . $search_terms_clean . ' %';
    788788    } elseif ( $query->query_vars['search_wildcard'] === 'right' ) {
    789         $search_terms_nospace =        $search_terms_clean . '%';
     789        $search_terms_nospace = $search_terms_clean . '%';
    790790        $search_terms_space   = '% ' . $search_terms_clean . '%';
    791791    } else {
     
    12531253 */
    12541254function bp_xprofile_get_hidden_fields_for_user( $displayed_user_id = 0, $current_user_id = 0 ) {
    1255     if ( !$displayed_user_id ) {
     1255    if ( ! $displayed_user_id ) {
    12561256        $displayed_user_id = bp_displayed_user_id();
    12571257    }
    12581258
    1259     if ( !$displayed_user_id ) {
     1259    if ( ! $displayed_user_id ) {
    12601260        return array();
    12611261    }
    12621262
    1263     if ( !$current_user_id ) {
     1263    if ( ! $current_user_id ) {
    12641264        $current_user_id = bp_loggedin_user_id();
    12651265    }
     
    13471347 */
    13481348function bp_xprofile_get_fields_by_visibility_levels( $user_id, $levels = array() ) {
    1349     if ( !is_array( $levels ) ) {
     1349    if ( ! is_array( $levels ) ) {
    13501350        $levels = (array)$levels;
    13511351    }
  • trunk/src/bp-xprofile/bp-xprofile-template.php

    r13392 r13393  
    424424        $field_ids = '';
    425425
    426         if ( !empty( $group->fields ) ) {
     426        if ( ! empty( $group->fields ) ) {
    427427            foreach ( (array) $group->fields as $field ) {
    428428                $field_ids .= $field->id . ',';
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-component.php

    r13093 r13393  
    139139
    140140        // Define a slug, if necessary.
    141         if ( !defined( 'BP_XPROFILE_SLUG' ) ) {
     141        if ( ! defined( 'BP_XPROFILE_SLUG' ) ) {
    142142            define( 'BP_XPROFILE_SLUG', 'profile' );
    143143        }
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-field-type-selectbox.php

    r13392 r13393  
    107107        $html    = '<option value="">' . /* translators: no option picked in select box */ esc_html__( '----', 'buddypress' ) . '</option>';
    108108
    109         if ( empty( $original_option_values ) && !empty( $_POST[ 'field_' . $this->field_obj->id ] ) ) {
     109        if ( empty( $original_option_values ) && ! empty( $_POST[ 'field_' . $this->field_obj->id ] ) ) {
    110110            $original_option_values = sanitize_text_field(  $_POST[ 'field_' . $this->field_obj->id ] );
    111111        }
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-field.php

    r13392 r13393  
    476476
    477477                // Allow plugins to filter the field's child options (i.e. the items in a selectbox).
    478                 $post_option  = ! empty( $_POST[ "{$this->type}_option" ]           ) ? $_POST[ "{$this->type}_option" ]           : '';
     478                $post_option  = ! empty( $_POST[ "{$this->type}_option" ]           ) ? $_POST[ "{$this->type}_option" ] : '';
    479479                $post_default = ! empty( $_POST[ "isDefault_{$this->type}_option" ] ) ? $_POST[ "isDefault_{$this->type}_option" ] : '';
    480480
     
    500500
    501501                $counter = 1;
    502                 if ( !empty( $options ) ) {
     502                if ( ! empty( $options ) ) {
    503503                    foreach ( (array) $options as $option_key => $option_value ) {
    504504                        $is_default = 0;
     
    12411241            ), $users_url . '#tabs-' . (int) $this->group_id );
    12421242
    1243             if ( !empty( $_POST['saveField'] ) ) {
     1243            if ( ! empty( $_POST['saveField'] ) ) {
    12441244                $this->name        = $_POST['title'];
    12451245                $this->description = $_POST['description'];
     
    12701270            <hr class="wp-header-end">
    12711271
    1272             <?php if ( !empty( $message ) ) : ?>
     1272            <?php if ( ! empty( $message ) ) : ?>
    12731273
    12741274                <div id="message" class="error fade notice is-dismissible">
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-profiledata.php

    r13392 r13393  
    6767     */
    6868    public function __construct( $field_id = null, $user_id = null ) {
    69         if ( !empty( $field_id ) ) {
     69        if ( ! empty( $field_id ) ) {
    7070            $this->populate( $field_id, $user_id );
    7171        }
     
    666666                    if ( $values[ $i ]->name == $fields[ $j ] ) {
    667667                        $new_values[ $fields[ $j ] ] = $values[ $i ]->value;
    668                     } elseif ( !array_key_exists( $fields[ $j ], $new_values ) ) {
     668                    } elseif ( ! array_key_exists( $fields[ $j ], $new_values ) ) {
    669669                        $new_values[ $fields[ $j ] ] = NULL;
    670670                    }
  • trunk/src/bp-xprofile/screens/edit.php

    r13392 r13393  
    6565
    6666        // There are errors.
    67         if ( !empty( $errors ) ) {
     67        if ( ! empty( $errors ) ) {
    6868            bp_core_add_message( __( 'Your changes have not been saved. Please fill in all required fields, and save your changes again.', 'buddypress' ), 'error' );
    6969
     
    8181                $value = isset( $_POST[ 'field_' . $field_id ] ) ? $_POST[ 'field_' . $field_id ] : '';
    8282
    83                 $visibility_level = !empty( $_POST[ 'field_' . $field_id . '_visibility' ] ) ? $_POST[ 'field_' . $field_id . '_visibility' ] : 'public';
     83                $visibility_level = ! empty( $_POST[ 'field_' . $field_id . '_visibility' ] ) ? $_POST[ 'field_' . $field_id . '_visibility' ] : 'public';
    8484
    8585                // Save the old and new values. They will be
     
    149149
    150150            // Set the feedback messages.
    151             if ( !empty( $errors ) ) {
     151            if ( ! empty( $errors ) ) {
    152152                bp_core_add_message( __( 'There was a problem updating some of your profile information. Please try again.', 'buddypress' ), 'error' );
    153153            } else {
  • trunk/src/bp-xprofile/screens/settings-profile.php

    r13392 r13393  
    9393            $visibility_level = 'public';
    9494
    95             if ( !empty( $_POST[ 'field_' . $field_id . '_visibility' ] ) ) {
     95            if ( ! empty( $_POST[ 'field_' . $field_id . '_visibility' ] ) ) {
    9696                $visibility_level = $_POST[ 'field_' . $field_id . '_visibility' ];
    9797            }
Note: See TracChangeset for help on using the changeset viewer.