Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/01/2024 05:06:17 PM (14 months ago)
Author:
espellcaste
Message:

WPCS: miscellaneous fixes for some of the files of the core component.

Closes https://github.com/buddypress/buddypress/pull/304
See #9164 and #7228

File:
1 edited

Legend:

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

    r13877 r13883  
    1717 *
    1818 * @param string $type_taxonomy The type's taxonomy name.
    19  * @return array                Default values for the taxonomy registered metadata.
     19 * @return array Default values for the taxonomy registered metadata.
    2020 */
    2121function bp_core_admin_get_type_default_meta_values( $type_taxonomy ) {
     
    4040 * @since 7.0.0
    4141 *
    42  * @param array  $args {
     42 * @param array $args {
    4343 *     Array of arguments describing the object type.
    4444 *
     
    6363
    6464    if ( ! $args['bp_type_id'] || ! $args['taxonomy'] ) {
    65          return new WP_Error(
    66              'invalid_type_taxonomy',
    67              __( 'The Type ID value is missing', 'buddypress' ),
    68              array(
    69                 'message' => 1,
    70              )
     65        return new WP_Error(
     66            'invalid_type_taxonomy',
     67            __( 'The Type ID value is missing', 'buddypress' ),
     68            array( 'message' => 1 )
    7169        );
    7270    }
     
    8078     * @since 7.0.0
    8179     *
    82      * @param boolean $value  True if the type exists. False otherwise.
    83      * @param string  $type_id The Type's ID.
     80     * @param boolean $existing_type True if the type exists. False otherwise.
     81     * @param string  $type_id       The Type's ID.
    8482     */
    8583    $type_exists = apply_filters( "{$type_taxonomy}_check_existing_type", false, $type_id );
     
    8987            'type_already_exists',
    9088            __( 'The Type already exists', 'buddypress' ),
    91             array(
    92                'message' => 5,
    93             )
    94        );
     89            array( 'message' => 5 )
     90        );
    9591    }
    9692
     
    9894    $metadata = bp_core_admin_get_type_default_meta_values( $type_taxonomy );
    9995
    100     // Validate metadata
     96    // Validate metadata.
    10197    $metas = array_filter( array_intersect_key( $args, $metadata ) );
    10298
     
    141137 * @since 7.0.0
    142138 *
    143  * @param array  $args {
     139 * @param array $args {
    144140 *     Array of arguments describing the object type.
    145141 *
     
    164160
    165161    if ( ! $args['type_term_id'] || ! $args['taxonomy'] ) {
    166          return new WP_Error(
    167              'invalid_type_taxonomy',
    168              __( 'The Term Type ID value is missing', 'buddypress' ),
    169              array(
    170                 'message' => 10,
    171             )
     162        return new WP_Error(
     163            'invalid_type_taxonomy',
     164            __( 'The Term Type ID value is missing', 'buddypress' ),
     165            array( 'message' => 10 )
    172166        );
    173167    }
     
    177171
    178172    // Get default values for metadata.
    179     $metadata  = bp_core_admin_get_type_default_meta_values( $type_taxonomy );
     173    $metadata = bp_core_admin_get_type_default_meta_values( $type_taxonomy );
    180174
    181175    // Merge customs with defaults.
     
    215209 * @since 7.0.0
    216210 *
    217  * @param array  $args {
     211 * @param array $args {
    218212 *     Array of arguments describing the object type.
    219213 *
     
    237231
    238232    if ( ! $args['type_term_id'] || ! $args['taxonomy'] ) {
    239          return new WP_Error(
    240              'invalid_type_taxonomy',
    241              __( 'The Term Type ID value is missing', 'buddypress' ),
    242              array(
    243                 'message' => 10,
    244             )
     233        return new WP_Error(
     234            'invalid_type_taxonomy',
     235            __( 'The Term Type ID value is missing', 'buddypress' ),
     236            array( 'message' => 10 )
    245237        );
    246238    }
     
    254246            'type_doesnotexist',
    255247            __( 'The type was not deleted: it does not exist.', 'buddypress' ),
    256             array(
    257                'message' => 6,
    258             )
     248            array( 'message' => 6 )
    259249        );
    260250    }
     
    267257            'type_register_by_code',
    268258            __( 'This type is registered using code, deactivate the plugin or remove the custom code before trying to delete it again.', 'buddypress' ),
    269             array(
    270                'message' => 7,
    271             )
     259            array( 'message' => 7 )
    272260        );
    273261    }
     
    279267            'type_not_deleted',
    280268            __( 'There was an error while trying to delete this type.', 'buddypress' ),
    281             array(
    282                'message' => 8,
    283             )
     269            array( 'message' => 8 )
    284270        );
    285271    }
Note: See TracChangeset for help on using the changeset viewer.