Title: send custom args in shortcode into function
Last modified: July 20, 2024

---

# send custom args in shortcode into function

 *  [websterhung](https://wordpress.org/support/users/websterhung/)
 * (@websterhung)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/send-custom-args-in-shortcode-into-function/)
 * Hello,
 * Thanks for the plugin that helps a lot.
 * And I’d like to know is it possible to get a custom args in shortcode and make
   it as a variable in the meta_query key in function?
 * I’d like to have my shortcode looks like this
 *     ```wp-block-code
       [query slug="history" args="hyear=2024"]
       ```
   
 * My custom callback called qw_custom_meta_query_filter_callback
 * and the code is as below
 *     ```wp-block-code
       function qw_custom_meta_query_filter_callback($args, $filter){		$args['meta_query'] = array(		array(			'key' => 'datetime',			'type' => 'CHAR',			'compare' => 'LIKE',			'value' => 2024		),	);	return $args;}
       ```
   
 * I don’t know how to replace the value into a variable
 * Hope someone would give me some advice!

The topic ‘send custom args in shortcode into function’ is closed to new replies.

 * ![](https://ps.w.org/query-wrangler/assets/icon-256x256.jpg?rev=3279076)
 * [Query Wrangler](https://wordpress.org/plugins/query-wrangler/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/query-wrangler/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/query-wrangler/)
 * [Active Topics](https://wordpress.org/support/plugin/query-wrangler/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/query-wrangler/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/query-wrangler/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [websterhung](https://wordpress.org/support/users/websterhung/)
 * Last activity: [1 year, 10 months ago](https://wordpress.org/support/topic/send-custom-args-in-shortcode-into-function/)
 * Status: not resolved