Hot answers tagged

2

This is actually not that hard, but you will have to excuse me for keeping it high level because this is just a stupid thing to do as all things which are security by obscurity. All you need to do is write your WPDB driver, which inherits the WPDB class. Place it in /wp-content/db.php file and make sure to initialize the global $wpdb object with your class. ...


1

You could use wp_parse_id_list() to sanitize your comma seperated list of post IDs. It's defined as: function wp_parse_id_list( $list ) { if ( !is_array($list) ) $list = preg_split('/[\s,]+/', $list); return array_unique(array_map('absint', $list)); } where we can see that it returns unique array values as well. Note that absint() is ...



Only top voted, non community-wiki answers of a minimum length are eligible