-
Notifications
You must be signed in to change notification settings - Fork 82
activitypub_extract_mentions
github-actions[bot] edited this page Aug 1, 2025
·
15 revisions
Filter the mentions in the post content.
/**
* Filter the mentions in the post content.
*
* @param array $mentions
* @param string $content
* @param Activitypub\Activity\Activity $item
* @return array The filtered mentions.
*/
function my_activitypub_extract_mentions_callback( array $mentions, string $content, Activitypub\Activity\Activity $item ) {
// Your code here.
return $mentions;
}
add_filter( 'activitypub_extract_mentions', 'my_activitypub_extract_mentions_callback', 10, 3 );
-
array
$mentions
The mentions. -
string
$content
The post content. -
Activitypub\Activity\Activity
$item
The Activity object.
array
The filtered mentions.
apply_filters(
'activitypub_extract_mentions',
array(),
$content,
$this->item
)
apply_filters( 'activitypub_extract_mentions', array(), $this->item->comment_content, $this->item )
apply_filters(
'activitypub_extract_mentions',
array(),
$this->item->post_content . ' ' . $this->item->post_excerpt,
$this->item
)
apply_filters(
'activitypub_extract_mentions',
array(),
$this->item->get_content() . ' ' . $this->item->get_summary(),
$this->item
)
Follow @[email protected] for updates and news.