Changeset 53216
- Timestamp:
- 04/19/2022 01:49:19 PM (3 years ago)
- Location:
- trunk/src/wp-admin/includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/deprecated.php
r53184 r53216 79 79 * 80 80 * @param int $default_category Unused. 81 * @param int $ parent_categoryUnused.81 * @param int $category_parent Unused. 82 82 * @param array $popular_ids Unused. 83 83 */ 84 function dropdown_categories( $default_category = 0, $ parent_category= 0, $popular_ids = array() ) {84 function dropdown_categories( $default_category = 0, $category_parent = 0, $popular_ids = array() ) { 85 85 _deprecated_function( __FUNCTION__, '2.6.0', 'wp_category_checklist()' ); 86 86 global $post_ID; … … 128 128 * @see wp_dropdown_categories() 129 129 * 130 * @param int $current_cat Optional. ID of the current category. Default 0.131 * @param int $current_parent Optional. Current parent category ID. Default 0.132 * @param int $ parent_catOptional. Parent ID to retrieve categories for. Default 0.133 * @param int $level Optional. Number of levels deep to display. Default 0.134 * @param array $categories Optional. Categories to include in the control. Default 0.130 * @param int $current_cat Optional. ID of the current category. Default 0. 131 * @param int $current_parent Optional. Current parent category ID. Default 0. 132 * @param int $category_parent Optional. Parent ID to retrieve categories for. Default 0. 133 * @param int $level Optional. Number of levels deep to display. Default 0. 134 * @param array $categories Optional. Categories to include in the control. Default 0. 135 135 * @return void|false Void on success, false if no categories were found. 136 136 */ 137 function wp_dropdown_cats( $current_cat = 0, $current_parent = 0, $ parent_cat = 0, $level = 0, $categories = 0 ) {137 function wp_dropdown_cats( $current_cat = 0, $current_parent = 0, $category_parent = 0, $level = 0, $categories = 0 ) { 138 138 _deprecated_function( __FUNCTION__, '3.0.0', 'wp_dropdown_categories()' ); 139 139 if (!$categories ) … … 142 142 if ( $categories ) { 143 143 foreach ( $categories as $category ) { 144 if ( $current_cat != $category->term_id && $ parent_cat == $category->parent) {144 if ( $current_cat != $category->term_id && $category_parent == $category->parent) { 145 145 $pad = str_repeat( '– ', $level ); 146 146 $category->name = esc_html( $category->name ); -
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.