Support

Account

Home Forums Add-ons Repeater Field $query->set for repeat field

Helping

$query->set for repeat field

  • Hello. could you help me?

    I am making a url request via the given parameters in functions.php

    
    if( isset($_GET['goal']) && $_GET['goal']) { // is working
       $query->set('meta_key', 'goal_$_text');
       $query->set('meta_value', $_GET['goal_$_text']);
       $query->set('compare', 'LIKE');
    }
    

    How to pass a field from a repeater to a given code? To filter out these values
    Example: localhost/shop?goal=text

  • See section 4. sub custom field values https://www.advancedcustomfields.com/resources/query-posts-custom-fields/

    Looking at your code I would assume

    
    if( isset($_GET['goal']) && $_GET['goal']) { // is working
       $query->set('meta_key', 'goal_$_text');
       $query->set('meta_value', $_GET['goal']);
       $query->set('compare', 'LIKE');
    }
    
Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘$query->set for repeat field’ is closed to new replies.