wp/wp-admin/includes/taxonomy.php
changeset 7 cf61fcea0001
parent 5 5e2f62d02dcd
child 9 177826044cd9
--- a/wp/wp-admin/includes/taxonomy.php	Tue Jun 09 11:14:17 2015 +0000
+++ b/wp/wp-admin/includes/taxonomy.php	Mon Oct 14 17:39:30 2019 +0200
@@ -65,7 +65,7 @@
  *
  * @param array $categories List of categories to create.
  * @param int   $post_id    Optional. The post ID. Default empty.
- * @return List of categories to create for the given post.
+ * @return array List of categories to create for the given post.
  */
 function wp_create_categories( $categories, $post_id = '' ) {
 	$cat_ids = array ();
@@ -93,10 +93,10 @@
  * @param array $catarr {
  *     Array of arguments for inserting a new category.
  *
- *     @type int        $cat_ID               Categoriy ID. A non-zero value updates an existing category.
+ *     @type int        $cat_ID               Category ID. A non-zero value updates an existing category.
  *                                            Default 0.
- *     @type string     $taxonomy             Taxonomy slug. Defualt 'category'.
- *     @type string     $cat_nam              Category name. Default empty.
+ *     @type string     $taxonomy             Taxonomy slug. Default 'category'.
+ *     @type string     $cat_name             Category name. Default empty.
  *     @type string     $category_description Category description. Default empty.
  *     @type string     $category_nicename    Category nice (display) name. Default empty.
  *     @type int|string $category_parent      Category parent ID. Default empty.
@@ -242,7 +242,7 @@
 	$terms = get_object_term_cache( $post_id, $taxonomy );
 	if ( false === $terms ) {
 		$terms = wp_get_object_terms( $post_id, $taxonomy );
-		wp_cache_add( $post_id, $terms, $taxonomy . '_relationships' );
+		wp_cache_add( $post_id, wp_list_pluck( $terms, 'term_id' ), $taxonomy . '_relationships' );
 	}
 
 	if ( ! $terms ) {
@@ -259,7 +259,7 @@
 	$terms_to_edit = esc_attr( join( ',', $term_names ) );
 
 	/**
-	 * Filter the comma-separated list of terms available to edit.
+	 * Filters the comma-separated list of terms available to edit.
 	 *
 	 * @since 2.8.0
 	 *