WordPress query: merge meta key (number) values and sort

I think this is the syntax you are after: $args = [ ‘posts_per_page’ => 5, ‘post_type’ => ‘post’, ‘meta_query’ => [ ‘relation’ => ‘OR’, ‘rating_au_clause’ => [ ‘key’ => ‘rating_au’, ‘compare’ => ‘EXISTS’ ], ‘rating_overall_clause’ => [ ‘key’ => ‘rating_overall’, ‘compare’ => ‘EXISTS’ ] ], ‘orderby’ => [ ‘rating_au_clause’ => ‘ASC’, ‘rating_overall_clause’ => ‘DESC’, ], … Read more

Need help in setting up a transient using API Key and if possible updating it in the ACF field

As discussed in the comments, here’s an attempt to fetch both pda and upa in a single request: /** * Make a Moz v1 URL Metrics request for a given domain * * @see https://moz.com/help/links-api/v1-archive/v1-url-metrics * @see https://moz.com/help/links-api/v1-archive/response-fields * @param $domain */ function moz_v1_links_api_request($domain) { if ( !$domain ) { return NULL; } $cache_key = … Read more

get the title of a relationship field

Updated version… <?php /** * @param $posts array * @return false|string */ function create_relationship_title($posts) { // set empty net title array $new_title = []; // if posts is not an array then return false if (!is_array($posts)) return false; // loop through each post foreach ($posts as $post) { // add the current post title to … Read more