X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/48ab98cb1779cf2088c1351ac3dd3d0da6fb31d3..88550bc3400cc7c035ff590ecb007c7938041ded:/wp-admin/includes/taxonomy.php?ds=sidebyside diff --git a/wp-admin/includes/taxonomy.php b/wp-admin/includes/taxonomy.php index 14618f88..c8c03848 100644 --- a/wp-admin/includes/taxonomy.php +++ b/wp-admin/includes/taxonomy.php @@ -11,14 +11,17 @@ // /** - * {@internal Missing Short Description}} + * Check whether a category exists. * * @since 2.0.0 * - * @param unknown_type $cat_name - * @return unknown + * @see term_exists() + * + * @param int|string $cat_name Category name. + * @param int $parent Optional. ID of parent term. + * @return mixed */ -function category_exists($cat_name, $parent = 0) { +function category_exists( $cat_name, $parent = null ) { $id = term_exists($cat_name, 'category', $parent); if ( is_array($id) ) $id = $id['term_id']; @@ -30,8 +33,8 @@ function category_exists($cat_name, $parent = 0) { * * @since 2.0.0 * - * @param unknown_type $id - * @return unknown + * @param int $id + * @return object */ function get_category_to_edit( $id ) { $category = get_term( $id, 'category', OBJECT, 'edit' ); @@ -44,9 +47,9 @@ function get_category_to_edit( $id ) { * * @since 2.0.0 * - * @param unknown_type $cat_name - * @param unknown_type $parent - * @return unknown + * @param int|string $cat_name + * @param int $parent + * @return int|WP_Error */ function wp_create_category( $cat_name, $parent = 0 ) { if ( $id = category_exists($cat_name, $parent) ) @@ -190,8 +193,8 @@ function wp_update_category($catarr) { * * @since 2.3.0 * - * @param unknown_type $tag_name - * @return unknown + * @param int|string $tag_name + * @return mixed */ function tag_exists($tag_name) { return term_exists($tag_name, 'post_tag'); @@ -202,8 +205,8 @@ function tag_exists($tag_name) { * * @since 2.3.0 * - * @param unknown_type $tag_name - * @return unknown + * @param int|string $tag_name + * @return array|WP_Error */ function wp_create_tag($tag_name) { return wp_create_term( $tag_name, 'post_tag'); @@ -214,8 +217,8 @@ function wp_create_tag($tag_name) { * * @since 2.3.0 * - * @param unknown_type $post_id - * @return unknown + * @param int $post_id + * @return string|bool|WP_Error */ function get_tags_to_edit( $post_id, $taxonomy = 'post_tag' ) { return get_terms_to_edit( $post_id, $taxonomy); @@ -226,8 +229,8 @@ function get_tags_to_edit( $post_id, $taxonomy = 'post_tag' ) { * * @since 2.8.0 * - * @param unknown_type $post_id - * @return unknown + * @param int $post_id + * @return string|bool|WP_Error */ function get_terms_to_edit( $post_id, $taxonomy = 'post_tag' ) { $post_id = (int) $post_id; @@ -273,8 +276,8 @@ function get_terms_to_edit( $post_id, $taxonomy = 'post_tag' ) { * * @since 2.8.0 * - * @param unknown_type $tag_name - * @return unknown + * @param int|string $tag_name + * @return array|WP_Error */ function wp_create_term($tag_name, $taxonomy = 'post_tag') { if ( $id = term_exists($tag_name, $taxonomy) )