soflyy / oxygen-bugs-and-features

Bug Reports & Feature Requests for Oxygen
https://oxygenbuilder.com/
315 stars 29 forks source link

Custom arguments in advanced query #3251

Open bohdanps opened 1 year ago

bohdanps commented 1 year ago

Describe the feature you'd like to see included in Oxygen. Option to add custom arguments to advanced query inside repeater element.

What are the use cases for this feature? Sometimes we need to add arguments beyond the defaults that come with WP_Query. For example, this WP Grid Builder tutorial requires to add a custom argument to WP_Query: image

And it's not possible right now.

You could say we can use "custom" option but then we lose the ability to add dynamic data to the query.

rvducay commented 1 year ago

+1

adamx12m commented 1 year ago

The same for FacetWP. 'facetwp' => true

Another idea instead of the visual wp_query builder allow an option to pass a custom $args block of plain old query code. While the "manual" mode of creating a custom query works most of the time, you can't have dynamic data like a date field, eg. show all posts before today using this mode.

shmaltz commented 11 months ago

Same for ElasticPress: ep_integrate => true

adamx12m commented 11 months ago

I think I ended up getting around this using pre_get_posts with facetwp.

function custom_query_arg( $query  ) {
    // wrap with page trigger logic
        $query->set('facetwp', true);
};
add_action( 'pre_get_posts', 'custom_query_arg' );