Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/26/2024 05:44:26 AM (11 months ago)
Author:
imath
Message:

Groups component: improve PHP code standards using WPCS

See #7228 (trunk)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/bp-groups-functions.php

    r13619 r13808  
    330330    // Backward compatibility with old method of passing arguments.
    331331    if ( ! is_array( $args ) || count( $function_args ) > 1 ) {
    332         _deprecated_argument( __METHOD__, '2.9.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
     332        _deprecated_argument( __METHOD__, '2.9.0', sprintf( esc_html__( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
    333333
    334334        $old_args_keys = array(
     
    813813    if ( ! is_array( $args ) || count( $function_args ) > 1 ) {
    814814        /* translators: 1: the name of the method. 2: the name of the file. */
    815         _deprecated_argument( __METHOD__, '2.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
     815        _deprecated_argument( __METHOD__, '2.0.0', sprintf( esc_html__( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
    816816
    817817        $old_args_keys = array(
     
    18321832    // Backward compatibility with old method of passing arguments.
    18331833    if ( ! is_array( $args[0] ) || count( $args ) > 1 ) {
    1834         _deprecated_argument( __METHOD__, '5.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
     1834        _deprecated_argument( __METHOD__, '5.0.0', sprintf( esc_html__( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
    18351835
    18361836        $old_args_keys = array(
     
    20482048function groups_demote_member( $user_id, $group_id ) {
    20492049
    2050     if ( ! bp_is_item_admin() )
     2050    if ( ! bp_is_item_admin() ) {
    20512051        return false;
     2052    }
    20522053
    20532054    $member = new BP_Groups_Member( $user_id, $group_id );
     
    20772078function groups_ban_member( $user_id, $group_id ) {
    20782079
    2079     if ( ! bp_is_item_admin() )
     2080    if ( ! bp_is_item_admin() ) {
    20802081        return false;
     2082    }
    20812083
    20822084    $member = new BP_Groups_Member( $user_id, $group_id );
     
    21062108function groups_unban_member( $user_id, $group_id ) {
    21072109
    2108     if ( ! bp_is_item_admin() )
     2110    if ( ! bp_is_item_admin() ) {
    21092111        return false;
     2112    }
    21102113
    21112114    $member = new BP_Groups_Member( $user_id, $group_id );
     
    21762179    // Backward compatibility with old method of passing arguments.
    21772180    if ( ! is_array( $args[0] ) || count( $args ) > 1 ) {
    2178         _deprecated_argument( __METHOD__, '5.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
     2181        _deprecated_argument( __METHOD__, '5.0.0', sprintf( esc_html__( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
    21792182
    21802183        $old_args_keys = array(
     
    22512254    if ( ! empty( $membership_id ) ) {
    22522255        /* translators: 1: the name of the method. 2: the name of the file. */
    2253         _deprecated_argument( __METHOD__, '5.0.0', sprintf( __( 'Argument `membership_id` passed to %1$s is deprecated. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
     2256        _deprecated_argument( __METHOD__, '5.0.0', sprintf( esc_html__( 'Argument `membership_id` passed to %1$s is deprecated. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
    22542257    }
    22552258
     
    22852288    if ( ! empty( $membership_id ) ){
    22862289        /* translators: 1: the name of the method. 2: the name of the file. */
    2287         _deprecated_argument( __METHOD__, '5.0.0', sprintf( __( 'Argument `membership_id` passed to %1$s is deprecated. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
     2290        _deprecated_argument( __METHOD__, '5.0.0', sprintf( esc_html__( 'Argument `membership_id` passed to %1$s is deprecated. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
    22882291    }
    22892292
     
    23232326    if ( ! empty( $membership_id ) ){
    23242327        /* translators: 1: the name of the method. 2: the name of the file. */
    2325         _deprecated_argument( __METHOD__, '5.0.0', sprintf( __( 'Argument `membership_id` passed to %1$s is deprecated. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
     2328        _deprecated_argument( __METHOD__, '5.0.0', sprintf( esc_html__( 'Argument `membership_id` passed to %1$s is deprecated. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
    23262329    }
    23272330
     
    26432646 */
    26442647function bp_group_type_tax_name() {
    2645     echo bp_get_group_type_tax_name();
     2648    echo esc_html( bp_get_group_type_tax_name() );
    26462649}
    26472650
     
    28782881
    28792882    if ( isset( $bp->groups->types[ $group_type ] ) ) {
    2880         return new WP_Error( 'bp_group_type_exists', __( 'Group type already exists.', 'buddypress' ), $group_type );
     2883        return new WP_Error( 'bp_group_type_exists', esc_html__( 'Group type already exists.', 'buddypress' ), $group_type );
    28812884    }
    28822885
Note: See TracChangeset for help on using the changeset viewer.