WP codex Create category , insert category, delete category

Create category
wp_create_category('My category name');
Insert Category
$cat_defaults = array(
  'cat_ID' => 0,
  'cat_name' => ,
  'category_description' => ,
  'category_nicename' => ,
  'category_parent' => ,
  'taxonomy' => 'category' );
Delete Category
$categ_ID = 3;
if ( wp_delete_category( $categ_ID ) ) {
  echo "Category #$categ_ID was successfully deleted";
} else {
  echo "Impossible to delete category #$categ_ID! Make sure it exists and that it's not the default category";
}

Posting Komentar

Lebih baru Lebih lama