Questions tagged [term-meta]
The term-meta tag has no usage guidance.
31
questions
1
vote
1
answer
60
views
Term meta not saved when adding the first category
I'd like to give administrators and editors the option to specify colors for categories they create. They'd enter in the hex colors they prefer e.g. #000.
I'm experiencing an odd issue in that the ...
0
votes
1
answer
35
views
Show taxonomy term meta field on single template
I have a custom taxonomy that has a metadata field with an image url. On the post type single template I have the below php and I need it to echo the meta field but it remains blank. I tried several ...
0
votes
1
answer
62
views
Modify Term List in Custom Taxonomy Meta Box
For the life of me, I can't find the hook for altering the list of terms in a custom taxonomy metabox.
On the post-edit screen, instead of list of custom taxonomy terms like this...
[ ] Bob Dylan
[ ] ...
1
vote
0
answers
27
views
Unable to import term_meta in wordpress using wp_cron
I have imported cities as term named as sf-cities I'm trying to add countries name as term meta I have attached sample of my code.
add_action( 'event_notification', 'import_countries', 10, 0 );
...
0
votes
1
answer
119
views
register_term_meta not working
I have a simple code snippet, and seems like I am missing something obvious.
add_action( 'init', 'custom_term_meta_setup');
function custom_term_meta_setup() {
register_term_meta( 'procedures', '...
0
votes
2
answers
87
views
How to stop get_queried_object_id() returning child term id's also
I use a conditional statement to display a shortcode depending on which category archive is being displayed. The issue I have is that if I use get_queried_object_id, the archive page for the parent ...
2
votes
1
answer
141
views
get_terms_args ordering by meta key not working
I have a custom taxonomy called "edition". Each edition has a meta key "_edition" that stores an incremental number from 1 to N. So, if I have an edition called "Edition 13&...
0
votes
1
answer
54
views
How to get the $meta_type given the $object_id
I'm trying to copy meta data from a term to an object when that term is assigned to the object by way of wp_set_object_terms(). When I hook into set_object_terms, I am able to obtain the desired $...
1
vote
1
answer
1k
views
How to filter products using filter products by attribute widget and OR logic between different product attribute types?
I have the following query url to filter products by 2 different attribute types:
https://www.example.com/product-category/customized-bags/?filter_wallet-type=womens-wallet&query_type_wallet-type=...
0
votes
1
answer
648
views
How to filter custom taxonomy term name, slug, and description?
I have a few people working on a website with me, and they need to create custom taxonomy terms using a very simple set of rules; however, they do not seem to understand how to do it. So, I'm trying ...
0
votes
1
answer
515
views
update_term_meta() only updating once on certain meta keys
I set up 4 custom meta fields on a custom taxonomy, and for some reason the field values for my 2 text fields only update the first time they are added to the database. Either from including them in ...
1
vote
0
answers
78
views
Toolset Types display custom term field
In Toolset Types I created a custom term field named "cp" with a color picker.
I'm trying to use the color in a title but I can't make it work. I searched the DB and found the field as "...
1
vote
1
answer
3k
views
Notice: Trying to get property 'term_id' of non-object
I receive the error on taxonomy page in wp-admin.Before this error, I had problem that couldnt add the taxonomy to menu because of my taxonomy code.I fixed the code then the current error became.So, ...
0
votes
0
answers
493
views
Is it possible to add Term Meta Fields to a WooCommerce Attribute?
Is it possible to add Term Meta Fields to a WooCommerce Attribute? I know I can do this with regular categories, but I'm wondering if there is a way to do this with product attributes. (without a ...
0
votes
0
answers
171
views
Get_term_meta() always returns false
I added an extra field (dropdown list with select options), when the user creates or edits a category from the WordPress dashboard. I am also able to store the selected value in the wp_termmeta table. ...
1
vote
1
answer
832
views
What is the "meta" key in WP_Term Object?
I thought it would be term meta but that doesn't seem to be correct.
For illustration I've created a category named "Test" with a slug of "test".
I'm updating its term_meta with:
update_term_meta( ...
0
votes
1
answer
409
views
meta_query to check all custom fields
I have to use the meta_query argument so that it checks for a keyword in all available custom field values (in array format) saved for the object. The meta keys are different for every object, ...
1
vote
1
answer
420
views
Audio player shortcode not showing up when using variable
I am trying to call a custom term meta field in an audio shortcode that I have placed on a custom page that I am working on. The field contains a link to a .mp3 file that I have uploaded to my media ...
1
vote
1
answer
2k
views
get_terms() order by term_meta
I'm doing a get_terms() query that I'm trying to order by a custom term meta. The custom term meta key is 'order' which as a numeric value (between 1 and 10). I have tried the following, but the order ...
0
votes
1
answer
476
views
Query Custom Post Type by Taxonomy Meta Value
I need to filter my custom post type "events" by Taxonomy Meta Field "city". But I can't make it work and need some help?
This is what I already have. But no results...
function aa_pre_get_posts($...
0
votes
1
answer
59
views
How to change default meta values in wordpress
I am very thankful to you all.
0
votes
1
answer
1k
views
Term Meta - saving multiple values in one form with select options
I have a working method for adding Term Meta for Taxonomy Terms. CPT is 'houses' and Taxonomy is 'house_feature'. This is my code...
First, possible values in an array:
$feature_groups = array(
'...
1
vote
2
answers
2k
views
WP_Query, tax_query and term_meta: How to?
I have a custom post type product (wine). Each of the following is a custom taxonomy:
Vintage (Year of harvesting) [only one per wine]
Family (Grape variety) [may be more than one]
Size (Bottle Size) ...
2
votes
1
answer
1k
views
Get ID of current taxonomy in register_rest_field
I have a term field created with types plugin and attached to the "category" taxonomy. I need to get this field in the api rest. You cant get the termmeta in types plugin like this
...
3
votes
2
answers
4k
views
Create taxonomy with meta term using the WP Rest Api
I am trying to create taxonomy elements (the taxonomies are already registered) from the front end using the REST Api v2. I am able to do so except not able to save the meta fields from the taxonomies....
0
votes
1
answer
2k
views
Adding custom ID field to the categories
I'm writing a plugin for importing products and categories from another CMS into Wordpress (with Woocommerce). To keep the structure of categories and to put products into the right categories I would ...
1
vote
0
answers
50
views
How to include term custom meta into the custom taxonomy term permalink structure
I made a custom taxonomy and I'm trying to customise the permalink structure for each term by using term custom meta. At the moment I have a custom post type magazine_article and a custom taxonomy ...
2
votes
1
answer
32k
views
Using get_terms() with meta_query parameters
Im trying to build a taxonomy query to only display the terms that have a certain custom field value assigned to it. The custom field holds a boolean value, so I tried:
$args = array(
'...
8
votes
3
answers
42k
views
Get term by custom term meta and taxonomy
How to get term by custom term meta and taxonomy or how to filter tax_query by term meta instead slug/id?
function custom_pre_get_posts($query)
{
global $wp_query;
if ( !is_admin() &&...
1
vote
1
answer
2k
views
Failure to add term meta
I'm working on a modification to a custom taxonomy that would allow content managers to specify a numeric order in which the terms shall appear in a widget. They can't rely on the alphabetical order ...
8
votes
5
answers
20k
views
Add custom taxonomy fields when creating a new taxonomy
Edit: Important note for WordPress v4.4 onward
This question used a great workaround for the lack of real term meta in older versions of WordPress, but since the release of WordPress v4.4, real term ...