Created
January 20, 2012 06:33
-
-
Save mjangda/1645766 to your computer and use it in GitHub Desktop.
How to generate an IN list that can be passed into a $wpdb call
This file contains 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 | |
$meta_keys = array( 'abc', 'def' ); | |
$meta_keys_in = sprintf( "'%s'", implode( "','", array_map( 'esc_sql', $meta_keys ) ) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment