Lubinik Learning

Training mode

REST API, AJAX & Gutenberg

Time remaining:

0 / 17 answered

  1. 1. What is required for the permission_callback of a custom REST route?

    Choose the safest general rule.

    What is required for the permission_callback of a custom REST route?
    Hint

    Public and protected routes both need an explicit permission decision.

  2. 2. Which hooks handle a custom WordPress AJAX action named save_note?

    The action may support both authenticated and unauthenticated visitors.

    Which hooks handle a custom WordPress AJAX action named save_note?
    Hint

    The unauthenticated variant has an extra suffix.

  3. 3. On which hook should custom REST API routes be registered?

    On which hook should custom REST API routes be registered?
    Hint

    The hook is dedicated to REST route registration.

  4. 4. What can a REST route argument definition provide?

    What can a REST route argument definition provide?
    Hint

    Separate input shape from authorization.

  5. 5. Which helper sends a JSON success response and terminates a WordPress AJAX request?

    Which helper sends a JSON success response and terminates a WordPress AJAX request?
    Hint

    WordPress provides paired success and error helpers.

  6. 6. What is the recommended role of block.json in modern block development?

    What is the recommended role of block.json in modern block development?
    Hint

    It is a manifest for a block.

  7. 7. When is a server-side render_callback particularly useful for a block?

    When is a server-side render_callback particularly useful for a block?
    Hint

    Consider a latest-posts style block.

  8. 8. What is a benefit of returning WP_REST_Response from a REST callback?

    What is a benefit of returning WP_REST_Response from a REST callback?
    Hint

    It is the response object for the REST server.

  9. 9. What problem does the WordPress Interactivity API address?

    What problem does the WordPress Interactivity API address?
    Hint

    It concerns frontend behavior in blocks.

  10. 10. Why should custom REST routes use a versioned namespace such as my-plugin/v1?

    Why should custom REST routes use a versioned namespace such as my-plugin/v1?
    Hint

    Routes are public identifiers.

  11. 11. How can a WP_Error returned by a REST callback specify an HTTP status?

    How can a WP_Error returned by a REST callback specify an HTTP status?
    Hint

    The REST server maps error data to the response.

  12. 12. What does register_rest_field() add?

    What does register_rest_field() add?
    Hint

    It extends the API representation.

  13. 13. On the frontend, how should a plugin usually provide admin-ajax.php and nonce values to its script?

    On the frontend, how should a plugin usually provide admin-ajax.php and nonce values to its script?
    Hint

    The server knows the correct URL and current nonce.

  14. 14. What do block attributes represent?

    What do block attributes represent?
    Hint

    They connect editor state with saved or rendered output.

  15. 15. What is the purpose of deprecated block versions in registerBlockType settings?

    What is the purpose of deprecated block versions in registerBlockType settings?
    Hint

    Existing posts may contain old markup.

  16. 16. What is a drawback of calling ServerSideRender for every small editor interaction?

    What is a drawback of calling ServerSideRender for every small editor interaction?
    Hint

    Consider editor responsiveness.

  17. 17. For cookie-authenticated REST requests from WordPress admin, which header commonly carries the REST nonce?

    For cookie-authenticated REST requests from WordPress admin, which header commonly carries the REST nonce?
    Hint

    wp.apiFetch middleware can supply it.