Skip to content

Conversation

@goldenapples
Copy link
Contributor

Example of js hook in post select ajax data, see discussion in #767 (comment)

With this in place, you would filter the data being sent with the ajax request something like

wp.shortcake.hooks.addFilter( 'shortcode_tag.attr.ajax-data', function addParams( response ) {
  response.date_query = $( date_query_field ).value;
  return response;
} )

and add any new arguments to the return value you want.

jaredcobb and others added 2 commits August 24, 2017 16:04
Adds a hook where the data sent along with the search request for a
select2 field can be filtered, for cases where the user wants to use the
value of one field to affect the search results returned for another.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants