Skip to content

wpce_after_document_from_post v3.31 β

Fires after a Document instance has been created via Document::from_post.

Parameters

  1. WPCE\Document $document

    The Document instance that has been created.

  2. ?WP_Post $post

    The post the document was loaded for. May be null to indicate that the post should be detected from the environment (e.g. the loop's current post or a $_GET['post'] parameter).

  3. bool $preview

    Whether the document has been loaded as a preview.

Example

php
add_action('wpce_after_document_from_post', function (WPCE\Document $document, ?WP_Post $post, bool $preview) {
	// ...
}, 10, 3);