Changeset 53216 for trunk/src/wp-admin/includes/taxonomy.php
- Timestamp:
- 04/19/2022 01:49:19 PM (4 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-admin/includes/taxonomy.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/taxonomy.php
r52236 r53216 18 18 * @see term_exists() 19 19 * 20 * @param int|string $cat_name Category name.21 * @param int $ parent Optional. ID of parent term.20 * @param int|string $cat_name Category name. 21 * @param int $category_parent Optional. ID of parent category. 22 22 * @return string|null Returns the category ID as a numeric string if the pairing exists, null if not. 23 23 */ 24 function category_exists( $cat_name, $ parent = null ) {25 $id = term_exists( $cat_name, 'category', $ parent );24 function category_exists( $cat_name, $category_parent = null ) { 25 $id = term_exists( $cat_name, 'category', $category_parent ); 26 26 if ( is_array( $id ) ) { 27 27 $id = $id['term_id']; … … 49 49 * @since 2.0.0 50 50 * 51 * @param int|string $cat_name 52 * @param int $ parent51 * @param int|string $cat_name Category name. 52 * @param int $category_parent Optional. ID of parent category. 53 53 * @return int|WP_Error 54 54 */ 55 function wp_create_category( $cat_name, $ parent = 0 ) {56 $id = category_exists( $cat_name, $ parent );55 function wp_create_category( $cat_name, $category_parent = 0 ) { 56 $id = category_exists( $cat_name, $category_parent ); 57 57 if ( $id ) { 58 58 return $id; … … 62 62 array( 63 63 'cat_name' => $cat_name, 64 'category_parent' => $ parent,64 'category_parent' => $category_parent, 65 65 ) 66 66 );
Note: See TracChangeset
for help on using the changeset viewer.