Last active
December 19, 2023 12:02
-
-
Save ihslimn/a9d34c749b1c8f3b692253ecbe42f875 to your computer and use it in GitHub Desktop.
JetEngine SQL Query Prepare string for IN
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 | |
add_action( 'jet-engine/query-builder/query/after-query-setup', function( $query ) { | |
if ( empty( $query->final_query['manual_query'] ) ) { | |
return; | |
} | |
$query->final_query['manual_query'] = preg_replace_callback( | |
'/\{explode(.+?)explode\}/', | |
function( $matches ) { | |
return str_replace( ',', '\',\'', $matches[1] ); | |
}, | |
$query->final_query['manual_query'] | |
); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment