Support

Account

Home Forums General Issues Meta_query key for nested fields Reply To: Meta_query key for nested fields

  • You cannot do a query like this on repeater fields.

    The actual field keys are build, for example for sales=>different_regions=>start_date, like this

    
    "sales_{$row_index}_different_regions_{$row_index}_start_date"
    

    This cannot be accomplished using WP_Query.

    In addition to this there isn’t any way to do any type of a query that will associate the indexes used for start_date with the indexes used for end_date. This is simply not possible in an SQL query.

    Here is an example. Lets say that you have these start and end dates in the repeater, these are just examples and not necessarily what is stored in the db.

    
    January 1, 2022 => February 1, 2022
    March 1, 2022 => April 1, 2022
    

    if today was February 10, 2022 then this post would match because this date is between one of the start dates and one of the end dates.