« first day (2802 days earlier)      last day (2131 days later) » 

9:16 AM
Is it possible to get posts with custom taxonomy, targeting a specific tax meta value... in one wp_query?
The meta_query par targets the CPT's meta values, not the tax meta...
So essentially, what I want is the option to target meta values within the tax_query par.
 
9:31 AM
Stack Exchange updates: Closing a question with active VLQ flag doesn\'t trigger automatic Community downvote anymore.
posted on June 13, 2018

Closing a question with active VLQ flag doesn't trigger automatic Community downvote anymore.

 
 
1 hour later…
10:51 AM
@ChristineCooper I don't think so, unless you set pass the result of get_terms() to the tax_query while setting the fields argument to ids.
 
11:02 AM
  $args = [
    'post_type' => 'post',
    'tax_query' => [
      [
        'taxonomy' => 'my_tax',
        'field'    => 'term_id',
        'terms'    => get_terms(
          [
            'taxonomy'   => 'my_tax',
            'fields'     => 'ids',
            'meta_query' => [
              [
                'key'     => 'some_key',
                'value'   => 'some_value',
                'compare' => '='
              ]
            ]
          ]
        ),
      ],
    ],
  ];
Something like this, which I'm sure you thought of it. But can't imagine the low performance of nested meta queries.
 
are you sure that's even possible?
keep in mind that if it is, then it's a truly earth shatteringly expensive query
the correct approach would be to do an expensive tax query first separately
 
Why not possible?
 
I've never seen it to be possible via WP_Query
but even if it's possible, it's highly undesirable
this suggests that the problem is data storage design
 
That's probably why no one uses it
 
if you ever need to get all posts X which have a term Z where Z has term meta Y, something has gone terrible wrong somewhere
 
11:07 AM
But the syntax should be correct.
 
I never knew that syntax was possible
a post meta query is super expensive, as is a term meta query
to then compound it with another layer makes it orders of magnitude more expensive
I would not expect a shared server to be able to handle that query with 1 active user on 1 page load
assuming 100 posts
 
I'd expect either mysql server has gone away, or time execution limit
 
Well that's OP's problem, I just wrote it to work in 1 query.
 
but those kinds of queries are hard on the DB server
order it by rand, and throw a not__in whose value comes from a HTTP request and you've got the absolute worst case scenario
 
11:10 AM
You're about to trigger WWIII if you keep adding stuff to the query.
 
eitherway, if you need to find posts in a term that has X, then X should have been a term in a taxonomy, not term meta
and don't forget, for those 1 in a million rare circumstances, you can have term taxonomies
where the objects being taxonomised are terms rather than posts
but i have literally never come across a situation that required it
 
@ChristineCooper Well she mentioned that she wants to target the terms meta
Assuming that she didn't mean taxonomy's meta itself ( do they even have meta by default? )
 
11:25 AM
no
 
 
3 hours later…
2:35 PM
0
Q: Call to a member function get_setting() on a non-object in

user9133196my theme name is buisness. add_action('wp_head','buisness_customize_css'); function buisness_footer_callout($wp_customize){ $wp_customize->add_section('buisness-footer-callout-section',array( 'title'=>'Footer-callout', )); $wp_customize->add_setting('buisness-footer-callout-headline',array( 'd...

 
3:21 PM
Thanks Jack! I meant the term's meta value. This is way to mental and not at all appropriate for a high trafficked platform. :D
I wonder if that query even works though.
I ended up by storing post ids in custom post meta. Far from ideal structure, but considerably more ideal when considering performance.
 
3:48 PM
End of the day brainscramble:
0
Q: Check on which page specific result exist

Christine CooperI have a $term_id = 123 and I want to find out on which page this term appears in the pagination. For example, we have: $args = array( 'taxonomy' => 'hello', 'offset' => $offset, 'number' => 10, // total per page 'hide_empty' => false, ); $term_query = new WP_Term_Qu...

 

« first day (2802 days earlier)      last day (2131 days later) »