Skip to content

Instantly share code, notes, and snippets.

@syamilmj
Created June 21, 2012 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save syamilmj/2967866 to your computer and use it in GitHub Desktop.
Save syamilmj/2967866 to your computer and use it in GitHub Desktop.
Fix "Cheatin' uh?" error on custom media upload buttons
/**
* Get rid of "Cheatin' uh?" error
* note: this will create a persistent "Hello World" post
*/
function aq_cheatin_uh(){
$id = 1;
$check = get_post($id);
if(! $check ) {
$post = array(
'post_title'=>'Hello World',
'post_content'=>'whatever',
'import_id'=>1,
);
wp_insert_post($post);
}
}
add_action('init', 'aq_cheatin_uh');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment