soflyy / oxygen-bugs-and-features

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

Change query_args Inside Easy Posts dynamically using a filter (fix is 2 lines of code) #970

Open A-Maged opened 4 years ago

A-Maged commented 4 years ago

Describe the feature you'd like to see included in Oxygen.

A clear, detailed description of the feature you're requesting.

$filter_name = 'oxygen_easyposts_query_' . $this->param_array[$id]['selector'];
$args = apply_filters($filter_name , $args );
$this->query = new WP_Query($args);

What are the use cases for this feature?

  1. CPT named "Teachers" has bidirectional custom field named "My_videos" (using pods not acf, it's more robust in this area) with another CPT named "Videos".
  2. developer needs to set "post__in" to be the IDs inside the bidirectional custom fields "My_videos" (hence dynamically)
elysiumspark commented 4 years ago

+1. Would love to see this same feature also to be on repeater element as well as the easy posts. I have a site right now where there are 50+ pages that are identical except that I need to query the repeater based on a variable in an ACF field on each of the pages. I don't see any way to do this except to create 50+ editable versions of a reusable Oxygen part (in other words, the same query 50 times changing the query only slightly)... which of course will be a nightmare to maintain if anything needs to change. Would love to see this in the future... thanks guys!

pavvel11 commented 3 years ago

+1 I also need to filter posts using a custom field from ACF and in another case I need to filter woocommerce products based on its properties.