wordpress page create when plugin activation
wordpress page on plugin activation:-
register_activation_hook(__FILE__, 'custom_plugin_create_page');
function custom_plugin_create_page(){
$page = array();
$page['post_type'] = 'page';
$page['post_title'] = 'custom plugin page';
$page['post_content'] = 'custom plugin page';
$page['post_status'] = 'publish';
$page['post_slug'] = 'custom-plugin';
wp_insert_post($page);
}
//ei code gula use korlei page create hoye jabe wordpress dashboard e.
No comments