Changeset 13983 for trunk/src/bp-core/admin/bp-core-admin-types.php
- Timestamp:
- 07/27/2024 06:44:41 PM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/admin/bp-core-admin-types.php
r13890 r13983 45 45 * @type string $taxonomy The Type's taxonomy. Required. 46 46 * @type string $bp_type_id Unique string identifier for the member type. Required. 47 * @type string $bp_type_singular_name Singular name for the member type. Required. 48 * @type string $bp_type_name Plural name for the member type. Required. 47 49 * @see keys of the array returned by bp_get_type_metadata_schema() for the other arguments. 48 50 * } 49 * @return int eger|WP_Error The Type's term ID on success. A WP_Error object otherwise.51 * @return int|WP_Error The Type's term ID on success. A WP_Error object otherwise. 50 52 */ 51 53 function bp_core_admin_insert_type( $args = array() ) { … … 53 55 'taxonomy' => '', 54 56 'bp_type_id' => '', 57 'bp_type_singular_name' => '', 58 'bp_type_name' => '', 55 59 ); 56 60 … … 67 71 __( 'The Type ID value is missing', 'buddypress' ), 68 72 array( 'message' => 1 ) 73 ); 74 } 75 76 if ( ! $args['bp_type_singular_name'] ) { 77 return new WP_Error( 78 'empty_field_singular', 79 __( 'The Singular Name value is missing', 'buddypress' ), 80 array( 81 'message' => 11, 82 ) 83 ); 84 } 85 86 if ( ! $args['bp_type_name'] ) { 87 return new WP_Error( 88 'empty_field_plural', 89 __( 'The Plural Name value is missing', 'buddypress' ), 90 array( 91 'message' => 12, 92 ) 69 93 ); 70 94 } … … 117 141 } 118 142 143 $type_term_id = reset( $type_term_id ); 144 119 145 /** 120 146 * Hook here to add code once the type has been inserted.
Note: See TracChangeset
for help on using the changeset viewer.