[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-admin/includes/ -> taxonomy.php (summary)

WordPress Taxonomy Administration API.

File Size: 316 lines (8 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 11 functions

  category_exists()
  get_category_to_edit()
  wp_create_category()
  wp_create_categories()
  wp_insert_category()
  wp_update_category()
  tag_exists()
  wp_create_tag()
  get_tags_to_edit()
  get_terms_to_edit()
  wp_create_term()

Functions
Functions that are not part of a class:

category_exists( $cat_name, $category_parent = null )   X-Ref
Checks whether a category exists.

param: int|string $cat_name        Category name.
param: int        $category_parent Optional. ID of parent category.
return: string|null Returns the category ID as a numeric string if the pairing exists, null if not.

get_category_to_edit( $id )   X-Ref
Gets category object for given ID and 'edit' filter context.

param: int $id
return: object

wp_create_category( $cat_name, $category_parent = 0 )   X-Ref
Adds a new category to the database if it does not already exist.

param: int|string $cat_name        Category name.
param: int        $category_parent Optional. ID of parent category.
return: int|WP_Error

wp_create_categories( $categories, $post_id = '' )   X-Ref
Creates categories for the given post.

param: string[] $categories Array of category names to create.
param: int      $post_id    Optional. The post ID. Default empty.
return: int[] Array of IDs of categories assigned to the given post.

wp_insert_category( $catarr, $wp_error = false )   X-Ref
Updates an existing Category or creates a new Category.

param: array $catarr {
param: bool  $wp_error Optional. Default false.
return: int|WP_Error The ID number of the new or updated Category on success. Zero or a WP_Error on failure,

wp_update_category( $catarr )   X-Ref
Aliases wp_insert_category() with minimal args.

If you want to update only some fields of an existing category, call this
function with only the new values set inside $catarr.

param: array $catarr The 'cat_ID' value is required. All other keys are optional.
return: int|false The ID number of the new or updated Category on success. Zero or FALSE on failure.

tag_exists( $tag_name )   X-Ref
Checks whether a post tag with a given name exists.

param: int|string $tag_name
return: mixed Returns null if the term does not exist.

wp_create_tag( $tag_name )   X-Ref
Adds a new tag to the database if it does not already exist.

param: int|string $tag_name
return: array|WP_Error

get_tags_to_edit( $post_id, $taxonomy = 'post_tag' )   X-Ref
Gets comma-separated list of tags available to edit.

param: int    $post_id
param: string $taxonomy Optional. The taxonomy for which to retrieve terms. Default 'post_tag'.
return: string|false|WP_Error

get_terms_to_edit( $post_id, $taxonomy = 'post_tag' )   X-Ref
Gets comma-separated list of terms available to edit for the given post ID.

param: int    $post_id
param: string $taxonomy Optional. The taxonomy for which to retrieve terms. Default 'post_tag'.
return: string|false|WP_Error

wp_create_term( $tag_name, $taxonomy = 'post_tag' )   X-Ref
Adds a new term to the database if it does not already exist.

param: string $tag_name The term name.
param: string $taxonomy Optional. The taxonomy within which to create the term. Default 'post_tag'.
return: array|WP_Error



Generated : Thu Nov 21 08:20:01 2024 Cross-referenced by PHPXref