Skip to:
Content

BuddyPress.org

Ticket #9092: 9092.2.patch

File 9092.2.patch, 5.6 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..e1716a3a2 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() ) { 
    7375                );
    7476        }
    7577
     78        if ( ! $args['bp_type_singular_name'] ) {
     79         return new WP_Error(
     80             'empty_field_singular',
     81             __( 'The 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             __( 'The 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-groups/bp-groups-admin.php

    diff --git a/src/bp-groups/bp-groups-admin.php b/src/bp-groups/bp-groups-admin.php
    index a4025e783..02d7de18e 100644
    a b function bp_groups_type_admin_updated_messages( $messages = array() ) { 
    14911491                8  => __( 'Sorry, there was an error while trying to delete this Group type.', 'buddypress' ),
    14921492                9  => __( 'Group type successfully deleted.', 'buddypress' ),
    14931493                10 => __( 'Group type could not be updated due to missing required information.', 'buddypress' ),
     1494                11 => __( 'Please define the Group Type Singular Name field.', 'buddypress' ),
     1495                12 => __( 'Please define the Group Type Plural Name field.', 'buddypress' ),
    14941496        );
    14951497
    14961498        return $messages;
  • src/bp-groups/bp-groups-functions.php

    diff --git a/src/bp-groups/bp-groups-functions.php b/src/bp-groups/bp-groups-functions.php
    index 50a618cd3..c327e11e5 100644
    a b function bp_get_group_type_tax_labels() { 
    27092709                        'back_to_items'                 => _x( '← Back to Group Types', 'Group type taxonomy back to items label', 'buddypress' ),
    27102710
    27112711                        // Specific to BuddyPress.
    2712                         'bp_type_id_label'              => _x( 'Group Type ID', 'BP Member type ID label', 'buddypress' ),
     2712                        'bp_type_id_label'              => _x( 'Group Type ID (required)', 'BP Member type ID label', 'buddypress' ),
    27132713                        'bp_type_id_description'        => _x( 'Lower-case string, no spaces or special characters. Used to identify the group type.', 'BP Group type ID description', 'buddypress' ),
    27142714                        'bp_type_show_in_create_screen' => _x( 'Show on Group Creation', 'BP Group type show in create screen', 'buddypress' ),
    27152715                        'bp_type_show_in_list'          => _x( 'Show on Group', 'BP Group type show in list', 'buddypress' ),
  • 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                )