Support

Account

Home Forums ACF PRO Filtering records by repeater field

Helping

Filtering records by repeater field

  • Using Advanced Custom Fields PRO, you need to filter posts by the field that is in the repeater in the database, the field has the following form:

    proizvolnoe_pole_0_vremya
    proizvolnoe_pole_1_vremya
    proizvolnoe_pole_2_vremya
    proizvolnoe_pole_3_vremya
    

    Accordingly, the repeater is called proizvolnoe_pole and an arbitrary field vremya
    how can I sort by this field, a bunch of queries of the form

    $args[ 'meta_query' ][] = array(
            array(
              'key'     => 'proizvolnoe_pole_0_vremya',
              'value'   => 4,
              'type'    => 'numeric',
              'compare' => '>'
            )
    );
    
    $args[ 'meta_query' ][] = array(
            array(
              'key'     => 'proizvolnoe_pole_1_vremya',
              'value'   => 4,
              'type'    => 'numeric',
              'compare' => '>'
            )
    

    What other options are there?

  • You cannot sort posts by a repeater field using a meta query.

    See this, internet archive, old but still valid

    https://web.archive.org/web/20190814230622/https://acfextras.com/dont-query-repeaters/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.