Changeset 61298
- Timestamp:
- 11/25/2025 01:32:39 AM (8 weeks ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 edited
-
src/wp-admin/includes/taxonomy.php (modified) (1 diff)
-
tests/phpunit/tests/term/wpCreateCategory.php (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/taxonomy.php
r60275 r61298 49 49 * @since 2.0.0 50 50 * 51 * @param int|string $cat_nameCategory name.52 * @param int $category_parent Optional. ID of parent category.53 * @return int |WP_Error54 */ 55 function wp_create_category( $cat _name, $category_parent = 0 ) {56 $id = category_exists( $cat _name, $category_parent );51 * @param string $category_name Category name. 52 * @param int $category_parent Optional. ID of parent category. 53 * @return int The ID of category term on success, or zero on failure. 54 */ 55 function wp_create_category( $category_name, $category_parent = 0 ) { 56 $id = category_exists( $category_name, $category_parent ); 57 57 if ( $id ) { 58 return $id;58 return (int) $id; 59 59 } 60 60 61 61 return wp_insert_category( 62 62 array( 63 'cat_name' => $cat _name,63 'cat_name' => $category_name, 64 64 'category_parent' => $category_parent, 65 65 )
Note: See TracChangeset
for help on using the changeset viewer.