wpce_before_document_from_post v3.20
Filters the post when a Document is loaded via Document::from_post.
Parameters
?WP_Post $postThe post to load the document for. May be
nullto indicate that the post should be detected from the environment (e.g. the loop's current post or a$_GET['post']parameter).bool $previewWhether the document is being loaded as a preview.
Example
php
add_filter('wpce_before_document_from_post', function (?WP_Post $post, bool $preview) {
// ...
return $post;
}, 10, 2);