Skip to:
Content

BuddyPress.org

Ticket #9092: 9092.patch

File 9092.patch, 4.1 KB (added by imranmd, 5 months ago)

patch added

  • src/bp-core/admin/bp-core-admin-types.php

    diff --git a/src/bp-core/admin/bp-core-admin-types.php b/src/bp-core/admin/bp-core-admin-types.php
    index 80e9982b2..6a419d5f3 100644
    a b function bp_core_admin_insert_type( $args = array() ) { 
    5454        $default_args = array(
    5555                'taxonomy'   => '',
    5656                'bp_type_id' => '',
     57                'bp_type_singular_name' => '',
     58        'bp_type_name' => '',
    5759        );
    5860
    5961        $args = array_map( 'wp_unslash', $args );
    function bp_core_admin_insert_type( $args = array() ) { 
    6668        if ( ! $args['bp_type_id'] || ! $args['taxonomy'] ) {
    6769                 return new WP_Error(
    6870                         'invalid_type_taxonomy',
    69                          __( 'The Type ID value is missing', 'buddypress' ),
     71                         __( 'Member Type ID value is missing', 'buddypress' ),
    7072                         array(
    7173                                'message' => 1,
    7274                         )
    7375                );
    7476        }
    7577
     78        if ( ! $args['bp_type_singular_name'] ) {
     79         return new WP_Error(
     80             'empty_field_singular',
     81             __( 'Member Type Singular Name value is missing', 'buddypress' ),
     82             array(
     83                'message' => 11,
     84             )
     85        );
     86    }
     87    if ( ! $args['bp_type_name'] ) {
     88         return new WP_Error(
     89             'empty_field_plural',
     90             __( 'Member Type Plural Name value is missing', 'buddypress' ),
     91             array(
     92                'message' => 12,
     93             )
     94        );
     95    }
     96
    7697        $type_id       = sanitize_title( $args['bp_type_id'] );
    7798        $type_taxonomy = sanitize_key( $args['taxonomy'] );
    7899
  • src/bp-core/bp-core-functions.php

    diff --git a/src/bp-core/bp-core-functions.php b/src/bp-core/bp-core-functions.php
    index d98b73e1c..910f48465 100644
    a b function bp_get_taxonomy_common_args() { 
    32893289 */
    32903290function bp_get_taxonomy_common_labels() {
    32913291        return array(
    3292                 'bp_type_name'           => _x( 'Plural Name', 'BP Type name label', 'buddypress' ),
    3293                 'bp_type_singular_name'  => _x( 'Singular name', 'BP Type singular name label', 'buddypress' ),
     3292                'bp_type_name'           => _x( 'Plural Name (required)', 'BP Type name label', 'buddypress' ),
     3293                'bp_type_singular_name'  => _x( 'Singular Name (required)', 'BP Type singular name label', 'buddypress' ),
    32943294                'bp_type_has_directory'  => _x( 'Has Directory View', 'BP Type has directory checkbox label', 'buddypress' ),
    32953295                'bp_type_directory_slug' => _x( 'Custom type directory slug', 'BP Type slug label', 'buddypress' ),
    32963296        );
  • src/bp-members/bp-members-admin.php

    diff --git a/src/bp-members/bp-members-admin.php b/src/bp-members/bp-members-admin.php
    index 7bef5cd9b..5f1ab28d0 100644
    a b function bp_members_type_admin_updated_messages( $messages = array() ) { 
    107107                8  => __( 'Sorry, there was an error while trying to delete this Member type.', 'buddypress' ),
    108108                9  => __( 'Member type successfully deleted.', 'buddypress' ),
    109109                10 => __( 'Member type could not be updated due to missing required information.', 'buddypress' ),
     110                11 => __( 'Please define the Member Type Singular Name field.', 'buddypress' ),
     111        12 => __( 'Please define the Member Type Plural Name field.', 'buddypress' ),
    110112        );
    111113
    112114        return $messages;
  • src/bp-members/bp-members-functions.php

    diff --git a/src/bp-members/bp-members-functions.php b/src/bp-members/bp-members-functions.php
    index 129a6f93d..e2fe05dd5 100644
    a b function bp_get_member_type_tax_labels() { 
    27402740                        'back_to_items'              => _x( '← Back to Member Types', 'Member type taxonomy back to items label', 'buddypress' ),
    27412741
    27422742                        // Specific to BuddyPress.
    2743                         'bp_type_id_label'           => _x( 'Member Type ID', 'BP Member type ID label', 'buddypress' ),
     2743                        'bp_type_id_label'           => _x( 'Member Type ID (required)', 'BP Member type ID label', 'buddypress' ),
    27442744                        'bp_type_id_description'     => _x( 'Enter a lower-case string without spaces or special characters (used internally to identify the member type).', 'BP Member type ID description', 'buddypress' ),
    27452745                        'bp_type_show_in_list'       => _x( 'Show on Member', 'BP Member type show in list', 'buddypress' ),
    27462746                )