Skip to content

Instantly share code, notes, and snippets.

@ihslimn
Last active December 19, 2023 12:02
Show Gist options
  • Save ihslimn/a9d34c749b1c8f3b692253ecbe42f875 to your computer and use it in GitHub Desktop.
Save ihslimn/a9d34c749b1c8f3b692253ecbe42f875 to your computer and use it in GitHub Desktop.
JetEngine SQL Query Prepare string for IN
<?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