0
I’m trying to create page when activating a plugin, however, when trying to access, says that the page was not found, it even arrives without created, but gets a tag "scheduled" Follows code below:
function projetos()
{
$post = array(
'comment_status' => 'open',
'ping_status' => 'closed' ,
'post_date' => date('Y-m-d H:i:s'),
'post_name' => 'Projeto',
'post_status' => 'publish' ,
'post_title' => 'Ver Projeto',
'post_type' => 'page',
);
$newvalue = wp_insert_post( $post, false );
update_option( 'proj-pages', $newvalue );
}
register_activation_hook( __FILE__, 'projetos');