Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- register_activation_hook( __FILE__, 'insert_page' );
- function insert_page(){
- // Create post object
- $my_post = array(
- 'post_title' => 'Menu',
- 'post_content' => 'Short Code',
- 'post_status' => 'publish',
- 'post_author' => get_current_user_id(),
- 'post_type' => 'page',
- );
- // Insert the post into the database
- wp_insert_post( $my_post, '' );
- $newvalue = wp_insert_post( $post, false );
- update_option( 'Menu', $newvalue );
- }
- register_deactivation_hook( __FILE__, 'deactivate_plugin' );
- function deactivate_plugin() {
- $page = get_page_by_title('Menu');
- wp_delete_post($page);
- }
Add Comment
Please, Sign In to add comment