Skip to content

Instantly share code, notes, and snippets.

@mjangda
Created January 20, 2012 06:33
Show Gist options
  • Save mjangda/1645766 to your computer and use it in GitHub Desktop.
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
<?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