Created
July 9, 2023 12:15
-
-
Save codersaiful/c9cf5e722bb28a1fd81c857df341ba8e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* If you want, that your table will display with default search | |
* suppose: you want to show product based on search keyword, | |
* use following code snippet | |
* | |
* you can add your code to your | |
* theme's functions.php file | |
* | |
* @author Saiful Islam <[email protected]> | |
*/ | |
add_filter('wpt_query_args',function($args, $shortcode){ | |
//Change your text here | |
$target_Text = 'Your text'; | |
$target_table_id = 20194; | |
if( $shortcode->table_id !== $target_table_id ) return $args; | |
if( empty( $target_Text ) ) return $args; | |
$args['s'] = $args['wpt-s'] = $target_Text; | |
$args['wpt_query_type'] = 'search'; | |
return $args; | |
}, 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment