- 
                Notifications
    
You must be signed in to change notification settings  - Fork 83
 
activitypub_get_image
        github-actions[bot] edited this page Oct 21, 2025 
        ·
        23 revisions
      
    Filter the image URL returned for each post.
/**
 * Filter the image URL returned for each post.
 *
 * @param array|false $thumbnail 
 * @param int         $id 
 * @param mixed $string 
 * @return array|false The filtered value.
 */
function my_activitypub_get_image_callback( array|false $thumbnail, int $id, string ) {
    // Your code here.
    return $thumbnail;
}
add_filter( 'activitypub_get_image', 'my_activitypub_get_image_callback', 10, 3 );- 
array|false$thumbnailThe image URL, or false if no image is available. - 
int$idThe attachment ID. - 
string$image_size The image size to retrieve. Set to 'large' by default. Other variable names:$image_size 
\apply_filters( 'activitypub_get_image', $this->get_attachment_image_src( $id, $image_size ), $id, $image_size )apply_filters(
			'activitypub_get_image',
			$this->get_attachment_image_src( $id, $image_size ),
			$id,
			$image_size
		)apply_filters(
			'activitypub_get_image',
			$this->get_attachment_image_src( $id, $image_size ),
			$id,
			$image_size
		)Follow @[email protected] for updates and news.