Changeset 13883 for trunk/src/bp-core/admin/bp-core-admin-types.php
- Timestamp:
- 06/01/2024 05:06:17 PM (14 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/admin/bp-core-admin-types.php
r13877 r13883 17 17 * 18 18 * @param string $type_taxonomy The type's taxonomy name. 19 * @return array 19 * @return array Default values for the taxonomy registered metadata. 20 20 */ 21 21 function bp_core_admin_get_type_default_meta_values( $type_taxonomy ) { … … 40 40 * @since 7.0.0 41 41 * 42 * @param array 42 * @param array $args { 43 43 * Array of arguments describing the object type. 44 44 * … … 63 63 64 64 if ( ! $args['bp_type_id'] || ! $args['taxonomy'] ) { 65 return new WP_Error( 66 'invalid_type_taxonomy', 67 __( 'The Type ID value is missing', 'buddypress' ), 68 array( 69 'message' => 1, 70 ) 65 return new WP_Error( 66 'invalid_type_taxonomy', 67 __( 'The Type ID value is missing', 'buddypress' ), 68 array( 'message' => 1 ) 71 69 ); 72 70 } … … 80 78 * @since 7.0.0 81 79 * 82 * @param boolean $ valueTrue if the type exists. False otherwise.83 * @param string $type_id The Type's ID.80 * @param boolean $existing_type True if the type exists. False otherwise. 81 * @param string $type_id The Type's ID. 84 82 */ 85 83 $type_exists = apply_filters( "{$type_taxonomy}_check_existing_type", false, $type_id ); … … 89 87 'type_already_exists', 90 88 __( 'The Type already exists', 'buddypress' ), 91 array( 92 'message' => 5, 93 ) 94 ); 89 array( 'message' => 5 ) 90 ); 95 91 } 96 92 … … 98 94 $metadata = bp_core_admin_get_type_default_meta_values( $type_taxonomy ); 99 95 100 // Validate metadata 96 // Validate metadata. 101 97 $metas = array_filter( array_intersect_key( $args, $metadata ) ); 102 98 … … 141 137 * @since 7.0.0 142 138 * 143 * @param array 139 * @param array $args { 144 140 * Array of arguments describing the object type. 145 141 * … … 164 160 165 161 if ( ! $args['type_term_id'] || ! $args['taxonomy'] ) { 166 return new WP_Error( 167 'invalid_type_taxonomy', 168 __( 'The Term Type ID value is missing', 'buddypress' ), 169 array( 170 'message' => 10, 171 ) 162 return new WP_Error( 163 'invalid_type_taxonomy', 164 __( 'The Term Type ID value is missing', 'buddypress' ), 165 array( 'message' => 10 ) 172 166 ); 173 167 } … … 177 171 178 172 // Get default values for metadata. 179 $metadata 173 $metadata = bp_core_admin_get_type_default_meta_values( $type_taxonomy ); 180 174 181 175 // Merge customs with defaults. … … 215 209 * @since 7.0.0 216 210 * 217 * @param array 211 * @param array $args { 218 212 * Array of arguments describing the object type. 219 213 * … … 237 231 238 232 if ( ! $args['type_term_id'] || ! $args['taxonomy'] ) { 239 return new WP_Error( 240 'invalid_type_taxonomy', 241 __( 'The Term Type ID value is missing', 'buddypress' ), 242 array( 243 'message' => 10, 244 ) 233 return new WP_Error( 234 'invalid_type_taxonomy', 235 __( 'The Term Type ID value is missing', 'buddypress' ), 236 array( 'message' => 10 ) 245 237 ); 246 238 } … … 254 246 'type_doesnotexist', 255 247 __( 'The type was not deleted: it does not exist.', 'buddypress' ), 256 array( 257 'message' => 6, 258 ) 248 array( 'message' => 6 ) 259 249 ); 260 250 } … … 267 257 'type_register_by_code', 268 258 __( 'This type is registered using code, deactivate the plugin or remove the custom code before trying to delete it again.', 'buddypress' ), 269 array( 270 'message' => 7, 271 ) 259 array( 'message' => 7 ) 272 260 ); 273 261 } … … 279 267 'type_not_deleted', 280 268 __( 'There was an error while trying to delete this type.', 'buddypress' ), 281 array( 282 'message' => 8, 283 ) 269 array( 'message' => 8 ) 284 270 ); 285 271 }
Note: See TracChangeset
for help on using the changeset viewer.