WordPress Development Complete Course: final quiz

Twelve questions covering the whole WordPress Development Complete Course.

  • Intermediate
  • 12 questions

12 questions. Pass mark 70%.

  1. Question 1 of 12 A client wants a “Testimonials” post type that must keep working if they switch theme next year. Where should you register it?
  2. Question 2 of 12 What does this filter callback do to post titles?
    PHP
    add_filter( 'the_title', 'myplugin_title' );
    
    function myplugin_title( $title ) {
    	strtoupper( $title );
    }
  3. Question 3 of 12 Your callback needs both arguments that the save_post action passes: the post ID and the post object. Which call is correct?
  4. Question 4 of 12 In which database table does WordPress store custom field values for posts?
  5. Question 5 of 12 You registered a custom post type with a new rewrite slug and its URLs return 404. What fixes it?
  6. Question 6 of 12 You need the five latest events for a sidebar and will never paginate them. Which arguments avoid unnecessary work?
    PHP
    $query = new WP_Query( array(
    	'post_type'      => 'myplugin_event',
    	'posts_per_page' => 5,
    	// ?
    ) );
  7. Question 7 of 12 Which is the right way to change how many posts the main blog archive shows?
  8. Question 8 of 12 Which of these stop a REST route from doing its work for users who cannot edit posts? Choose two.

    Select all that apply.

  9. Question 9 of 12 You print a post meta value inside an HTML attribute. Which is correct?
    PHP
    $colour = get_post_meta( $post_id, 'myplugin_colour', true );
  10. Question 10 of 12 Which query is safe when $email comes from user input?
  11. Question 11 of 12 What happens to a transient after its expiry time has passed?
  12. Question 12 of 12 After moving a site from staging to production, which WP-CLI command updates the old domain stored in the database, including inside serialised data?