How to get the $meta_type given the $object_id

Given the $object_id (and a WP_Term object), how does one go about determining the $meta_type to be passed to update_metadata()? Unfortunately, that is not possible because each object has its own table and therefore the same ID (1, 2, 3, etc.) could refer to a post, comment, term, etc. So that’s why we have different … Read more

Failure to add term meta

This turned out to be a database issue. Due to some security measures put in place by the infrastructure team, the network upgrade script was prevented from completing the upgrade on all sites. Thus, for the specific site within our WordPress Network on which this plugin was being tested, the wp_termmeta table had not been … Read more

How to filter products using filter products by attribute widget and OR logic between different product attribute types?

Issue #1 (nested tax_query with OR relation) After going through WordPress core and WooCommerce core, it appears query_type_bag-type=or (query_type_.$attribute) query arg is only changing the value of the operator key on the individual taxonomy array for the attribute. For example: query_type_pa_color=and = operator => ‘AND’ query_type_pa_color=or = operator => ‘IN’ You can see in the … Read more

get_terms() order by term_meta

the order doesn’t seem to follow the meta value Yes, and it’s because you set the meta key like this: (which doesn’t actually set the meta key) array( ‘key’ => ‘order’, ), The proper way is by using the meta_key parameter: ‘meta_key’ => ‘order’ So the full code would be: $type_terms = get_terms( ‘type’, array( … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)