How do I update bricks/posts/query_vars with element->settings

I’m creating a custom query that is added to the list of queries by a plugin. I’m also adding a few controls if that query objectType is used. I’d like to be able to change/update the query_vars based on changes in that element’s controls, but I don’t want to have to grab the element ID every time (it’s a plugin after all).

Is this possible? If so, how might I go about doing that? I haven’t been able to find anything in the docs or via Google.

1 Like

All my code is in the main plugin file. Here’s my current order of operations:

  1. Set up new controls on [container|block|div] elements with the bricks/element/[c|b|d]/controls filter.
  2. Initialize the custom query item and add it to the query options with bricks/setup/control_options
  3. Call the bricks/query/run filter
  4. Set up the post data with the bricks/query/loop_object filter.

No matter how I change the controls I added in step 1, the query doesn’t update.

It seems like I need to get the element and its settings somewhere, but I don’t know where or how to do that from the main plugin file.

1 Like

My thoughts exactly. The filter page needs better documentation. It won’t even return a wp_die(); for testing purposes.