1

Your query args are not quite correct. When you want to order by a custom field, you need to specify a meta_key argument, and set your orderby to the kind of ordering you need. For example: $args = array( 'tax_query' => array( array( 'taxonomy' => 'topic', 'field' => 'slug', 'terms' => 'movie',...


1

This is the PHP serialization format, and is used to serialize arrays for storage in the database. Core WordPress functions take care of this process for you. You just need to use an array as the value. For example, this: $schema_article = array( 'headline' => 'aaa', ); update_post_meta( $remote_id, '_schema_article', $schema_article ); Will save ...


1

Is there a smart way to meta_query so it matches just "IS, but not "TS-IS"? The WordPress meta query class (WP_Meta_Query), which among others, is used with the posts (WP_Query) and users (WP_User_Query) query classes, supports REGEXP (since WordPress 3.7) as the compare value, so you could use that with a RegEx (regular expresion) pattern ...


1

A good alternative to wp_set_object_terms is wp_set_post_terms() if you are dealing with a post object. It has a Boolean 4th parameter that lets you decide whether you will merely add terms or overwrite the existing ones.


Only top voted, non community-wiki answers of a minimum length are eligible