144 'search_items' => __( 'Search Link Categories' ), |
144 'search_items' => __( 'Search Link Categories' ), |
145 'popular_items' => null, |
145 'popular_items' => null, |
146 'all_items' => __( 'All Link Categories' ), |
146 'all_items' => __( 'All Link Categories' ), |
147 'edit_item' => __( 'Edit Link Category' ), |
147 'edit_item' => __( 'Edit Link Category' ), |
148 'update_item' => __( 'Update Link Category' ), |
148 'update_item' => __( 'Update Link Category' ), |
149 'add_new_item' => __( 'Add New Link Category' ), |
149 'add_new_item' => __( 'Add Link Category' ), |
150 'new_item_name' => __( 'New Link Category Name' ), |
150 'new_item_name' => __( 'New Link Category Name' ), |
151 'separate_items_with_commas' => null, |
151 'separate_items_with_commas' => null, |
152 'add_or_remove_items' => null, |
152 'add_or_remove_items' => null, |
153 'choose_from_most_used' => null, |
153 'choose_from_most_used' => null, |
154 'back_to_items' => __( '← Go to Link Categories' ), |
154 'back_to_items' => __( '← Go to Link Categories' ), |
231 'publicly_queryable' => false, |
231 'publicly_queryable' => false, |
232 'hierarchical' => false, |
232 'hierarchical' => false, |
233 'labels' => array( |
233 'labels' => array( |
234 'name' => _x( 'Pattern Categories', 'taxonomy general name' ), |
234 'name' => _x( 'Pattern Categories', 'taxonomy general name' ), |
235 'singular_name' => _x( 'Pattern Category', 'taxonomy singular name' ), |
235 'singular_name' => _x( 'Pattern Category', 'taxonomy singular name' ), |
236 'add_new_item' => __( 'Add New Category' ), |
236 'add_new_item' => __( 'Add Category' ), |
237 'add_or_remove_items' => __( 'Add or remove pattern categories' ), |
237 'add_or_remove_items' => __( 'Add or remove pattern categories' ), |
238 'back_to_items' => __( '← Go to Pattern Categories' ), |
238 'back_to_items' => __( '← Go to Pattern Categories' ), |
239 'choose_from_most_used' => __( 'Choose from the most used pattern categories' ), |
239 'choose_from_most_used' => __( 'Choose from the most used pattern categories' ), |
240 'edit_item' => __( 'Edit Pattern Category' ), |
240 'edit_item' => __( 'Edit Pattern Category' ), |
241 'item_link' => __( 'Pattern Category Link' ), |
241 'item_link' => __( 'Pattern Category Link' ), |
676 * Default 'The description is not prominent by default; |
676 * Default 'The description is not prominent by default; |
677 * however, some themes may show it'. |
677 * however, some themes may show it'. |
678 * @type string $edit_item Default 'Edit Tag'/'Edit Category'. |
678 * @type string $edit_item Default 'Edit Tag'/'Edit Category'. |
679 * @type string $view_item Default 'View Tag'/'View Category'. |
679 * @type string $view_item Default 'View Tag'/'View Category'. |
680 * @type string $update_item Default 'Update Tag'/'Update Category'. |
680 * @type string $update_item Default 'Update Tag'/'Update Category'. |
681 * @type string $add_new_item Default 'Add New Tag'/'Add New Category'. |
681 * @type string $add_new_item Default 'Add Tag'/'Add Category'. |
682 * @type string $new_item_name Default 'New Tag Name'/'New Category Name'. |
682 * @type string $new_item_name Default 'New Tag Name'/'New Category Name'. |
683 * @type string $template_name Default 'Tag Archives'/'Category Archives'. |
683 * @type string $template_name Default 'Tag Archives'/'Category Archives'. |
684 * @type string $separate_items_with_commas This label is only used for non-hierarchical taxonomies. Default |
684 * @type string $separate_items_with_commas This label is only used for non-hierarchical taxonomies. Default |
685 * 'Separate tags with commas', used in the meta box. |
685 * 'Separate tags with commas', used in the meta box. |
686 * @type string $add_or_remove_items This label is only used for non-hierarchical taxonomies. Default |
686 * @type string $add_or_remove_items This label is only used for non-hierarchical taxonomies. Default |
1384 * |
1384 * |
1385 * @since 4.4.0 |
1385 * @since 4.4.0 |
1386 * |
1386 * |
1387 * @param int $term_id Term ID. |
1387 * @param int $term_id Term ID. |
1388 * @param string $meta_key Metadata name. |
1388 * @param string $meta_key Metadata name. |
1389 * @param mixed $meta_value Metadata value. Must be serializable if non-scalar. |
1389 * @param mixed $meta_value Metadata value. Arrays and objects are stored as serialized data and |
|
1390 * will be returned as the same type when retrieved. Other data types will |
|
1391 * be stored as strings in the database: |
|
1392 * - false is stored and retrieved as an empty string ('') |
|
1393 * - true is stored and retrieved as '1' |
|
1394 * - numbers (both integer and float) are stored and retrieved as strings |
|
1395 * Must be serializable if non-scalar. |
1390 * @param bool $unique Optional. Whether the same key should not be added. |
1396 * @param bool $unique Optional. Whether the same key should not be added. |
1391 * Default false. |
1397 * Default false. |
1392 * @return int|false|WP_Error Meta ID on success, false on failure. |
1398 * @return int|false|WP_Error Meta ID on success, false on failure. |
1393 * WP_Error when term_id is ambiguous between taxonomies. |
1399 * WP_Error when term_id is ambiguous between taxonomies. |
1394 */ |
1400 */ |
1428 * This parameter has no effect if `$key` is not specified. |
1434 * This parameter has no effect if `$key` is not specified. |
1429 * Default false. |
1435 * Default false. |
1430 * @return mixed An array of values if `$single` is false. |
1436 * @return mixed An array of values if `$single` is false. |
1431 * The value of the meta field if `$single` is true. |
1437 * The value of the meta field if `$single` is true. |
1432 * False for an invalid `$term_id` (non-numeric, zero, or negative value). |
1438 * False for an invalid `$term_id` (non-numeric, zero, or negative value). |
1433 * An empty string if a valid but non-existing term ID is passed. |
1439 * An empty array if a valid but non-existing term ID is passed and `$single` is false. |
|
1440 * An empty string if a valid but non-existing term ID is passed and `$single` is true. |
|
1441 * Note: Non-serialized values are returned as strings: |
|
1442 * - false values are returned as empty strings ('') |
|
1443 * - true values are returned as '1' |
|
1444 * - numbers are returned as strings |
|
1445 * Arrays and objects retain their original type. |
1434 */ |
1446 */ |
1435 function get_term_meta( $term_id, $key = '', $single = false ) { |
1447 function get_term_meta( $term_id, $key = '', $single = false ) { |
1436 return get_metadata( 'term', $term_id, $key, $single ); |
1448 return get_metadata( 'term', $term_id, $key, $single ); |
1437 } |
1449 } |
1438 |
1450 |