Skip to content

Commit b956f5b

Browse files
kraftbjpfefferle
andauthored
Posts: add pre-fetch hook to allow plugins to hang filters on (#487)
Co-authored-by: Matthias Pfefferle <[email protected]>
1 parent e05176c commit b956f5b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

includes/transformer/class-post.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,15 @@ protected function get_tags() {
452452
protected function get_content() {
453453
global $post;
454454

455+
/**
456+
* Provides an action hook so plugins can add their own hooks/filters before AP content is generated.
457+
*
458+
* Example: if a plugin adds a filter to `the_content` to add a button to the end of posts, it can also remove that filter here.
459+
*
460+
* @param WP_Post $post The post object.
461+
*/
462+
do_action( 'activitypub_before_get_content', $post );
463+
455464
// phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
456465
$post = $this->wp_post;
457466
$content = $this->get_post_content_template();

0 commit comments

Comments
 (0)