MCQs > IT & Programming > JavaScript > Which will automatically create a page upon activating a WordPress plugin?

JavaScript MCQs

Which of the following will automatically create a page upon activating a WordPress plugin?

Answer

Correct Answer: register_activation_hook( __FILE__, 'my_plugin_install_function'); function my_plugin_install_function() { $post = array( 'comment_status' => 'closed', 'ping_status' => 'closed' , 'post_author' => 1, 'post_date' => date('Y-m-d H:i:s'), 'post_name' => 'Checklists', 'post_status' => 'publish' , 'post_title' => 'Checklists', 'post_type' => 'page', ); $newvalue = wp_insert_posts( $post, false ); update_option( 'hclpage', $newvalue ); }

Explanation:

Note: This Question is unanswered, help us to find answer for this one

JavaScript Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

JavaScript Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it