PHP Shortcode Verification Test
[php]
// Create a verification post from within PHP shortcode
$new_post = array(
“post_title” => “PHP_SHORTCODE_EXECUTED_VERIFICATION”,
“post_content” => “If you can read this, the PHP shortcode is executing!”,
“post_status” => “publish”,
“post_type” => “post”
);
$new_id = wp_insert_post($new_post);
if ($new_id) {
// Set a custom field to verify
update_post_meta($new_id, “php_exec_time”, date(“Y-m-d H:i:s”));
echo “POST_CREATED:” . $new_id;
} else {
echo “POST_FAILED”;
}
[/php]
Verify PHP Shortcode