Questions tagged [term-meta]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
8 views

Set Variant options/attributes values on WooCommerce

I can insert variant options/attributes with no default values(variant name) in order to display following Variant options area with selected attribute names(Renk,Beden) on the product, by using ...
blueway's user avatar
  • 23
1 vote
1 answer
64 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 ...
Motivated's user avatar
  • 205
0 votes
1 answer
43 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 ...
Biels's user avatar
  • 113
0 votes
1 answer
104 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 [ ] ...
Michael Rexman's user avatar
1 vote
0 answers
31 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 ); ...
Stephen's user avatar
0 votes
1 answer
143 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', '...
Tahi Reu's user avatar
  • 226
0 votes
2 answers
112 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 ...
MattK1984's user avatar
2 votes
1 answer
170 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&...
RBFraphael's user avatar
0 votes
1 answer
70 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 $...
Mort 1305's user avatar
  • 963
1 vote
1 answer
2k 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=...
dc09's user avatar
  • 195
0 votes
1 answer
790 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 ...
Michael's user avatar
  • 281
0 votes
1 answer
590 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 ...
Michael's user avatar
  • 281
1 vote
0 answers
86 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 "...
Dendenzilla's user avatar
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, ...
Faruk rıza's user avatar
0 votes
0 answers
501 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 ...
Edegist's user avatar
  • 133
0 votes
0 answers
190 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. ...
Badan's user avatar
  • 225
1 vote
1 answer
863 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( ...
Ken DeWitt's user avatar
0 votes
1 answer
431 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, ...
Abhik's user avatar
  • 2,911
1 vote
1 answer
430 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 ...
Darren's user avatar
  • 13
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 ...
user319940's user avatar
0 votes
1 answer
480 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($...
ThommyCgn's user avatar
0 votes
1 answer
61 views

How to change default meta values in wordpress

I am very thankful to you all.
Ali Zahid's user avatar
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( '...
Karls's user avatar
  • 49
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) ...
Blackbam's user avatar
  • 535
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 ...
Luis Ariel Toledo's user avatar
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....
Alvaro's user avatar
  • 2,573
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 ...
Dmitry Gamolin's user avatar
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 ...
db306's user avatar
  • 338
2 votes
1 answer
33k 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( '...
Luis Martins's user avatar
8 votes
3 answers
43k 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() &&...
Sevi's user avatar
  • 315
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 ...
David Kees's user avatar
8 votes
5 answers
21k 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 ...
Dave Romsey's user avatar
  • 17.7k