Created
June 21, 2012 19:08
-
-
Save syamilmj/2967866 to your computer and use it in GitHub Desktop.
Fix "Cheatin' uh?" error on custom media upload buttons
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
/** | |
* 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