Lubinik Learning

Training mode

Plugins, CPTs & Taxonomies

Time remaining:

0 / 16 answered

  1. 1. Which hook is normally used to register a Custom Post Type?

    You want to call register_post_type() at the point recommended by WordPress.

    Which hook is normally used to register a Custom Post Type?
    Hint

    This hook runs after WordPress has loaded but before the main request is processed.

  2. 2. When should a custom taxonomy normally be registered?

    Choose the conventional WordPress lifecycle hook.

    When should a custom taxonomy normally be registered?
    Hint

    It is the same common lifecycle point used for CPT registration.

  3. 3. When should a plugin normally flush rewrite rules for a new CPT?

    Choose the approach that avoids unnecessary work on normal requests.

    When should a plugin normally flush rewrite rules for a new CPT?
    Hint

    Flushing is expensive and registration must happen first.

  4. 4. What makes a PHP file discoverable as a WordPress plugin?

    What makes a PHP file discoverable as a WordPress plugin?
    Hint

    Look at how the Plugins screen discovers files.

  5. 5. When should permanent plugin data normally be deleted?

    When should permanent plugin data normally be deleted?
    Hint

    A user may deactivate only to debug temporarily.

  6. 6. Why should plugin post types, taxonomies, options and functions use a unique prefix or namespace?

    Why should plugin post types, taxonomies, options and functions use a unique prefix or namespace?
    Hint

    Several plugins share the same runtime.

  7. 7. Why register post meta with register_post_meta() or register_meta()?

    Why register post meta with register_post_meta() or register_meta()?
    Hint

    Think schema and access rules.

  8. 8. How should a shortcode callback normally provide its markup?

    How should a shortcode callback normally provide its markup?
    Hint

    The content filter decides where the result belongs.

  9. 9. Why do plugin PHP files often begin with an ABSPATH guard?

    Why do plugin PHP files often begin with an ABSPATH guard?
    Hint

    ABSPATH is defined by WordPress.

  10. 10. What is unusual about variable scope inside a plugin activation callback?

    What is unusual about variable scope inside a plugin activation callback?
    Hint

    Prefer explicit inputs and APIs.

  11. 11. How should a plugin react when a required dependency is unavailable?

    How should a plugin react when a required dependency is unavailable?
    Hint

    Administrators need a recoverable state.

  12. 12. What does the Settings API help a plugin manage?

    What does the Settings API help a plugin manage?
    Hint

    Think register_setting().

  13. 13. What is dbDelta() designed to help with?

    What is dbDelta() designed to help with?
    Hint

    It is commonly used during versioned migrations.

  14. 14. Why store a plugin database schema version?

    Why store a plugin database schema version?
    Hint

    Activation is not guaranteed to run during every deployment pattern.

  15. 15. Why should plugin strings use a consistent text domain?

    Why should plugin strings use a consistent text domain?
    Hint

    It is part of internationalization calls.

  16. 16. Which hooks handle authenticated custom form requests sent to admin-post.php?

    Which hooks handle authenticated custom form requests sent to admin-post.php?
    Hint

    It is the non-AJAX administrative form endpoint.