diff --git src/bp-core/admin/bp-core-admin-types.php src/bp-core/admin/bp-core-admin-types.php
index 6b8db3f7a..7ad849ca5 100644
|
|
function bp_core_admin_insert_type( $args = array() ) { |
63 | 63 | 'admin_insert_type' |
64 | 64 | ); |
65 | 65 | |
66 | | if ( ! $args['bp_type_id'] || ! $args['taxonomy'] ) { |
| 66 | if ( ( ! $args['bp_type_id'] && ! $args['bp_type_singular_name'] ) || ! $args['taxonomy'] ) { |
67 | 67 | return new WP_Error( |
68 | 68 | 'invalid_type_taxonomy', |
69 | | __( 'The Type ID value is missing', 'buddypress' ), |
| 69 | __( 'The Type ID or singular name value is missing', 'buddypress' ), |
70 | 70 | array( |
71 | 71 | 'message' => 1, |
72 | 72 | ) |
73 | 73 | ); |
74 | 74 | } |
75 | 75 | |
| 76 | if ( ! $args['bp_type_id'] && $args['bp_type_singular_name'] ) { |
| 77 | $args['bp_type_id'] = sanitize_title( $args['bp_type_singular_name'] ); |
| 78 | } |
| 79 | |
76 | 80 | $type_id = sanitize_title( $args['bp_type_id'] ); |
77 | 81 | $type_taxonomy = sanitize_key( $args['taxonomy'] ); |
78 | 82 | |