Skip to content

activitypub_get_image

github-actions[bot] edited this page Jul 29, 2025 · 13 revisions

Filter the image URL returned for each post.

Auto-generated Example

add_filter(
   'activitypub_get_image',
    'my_activitypub_get_image_callback',
    10,
    3
);

function my_activitypub_get_image_callback(
    array|false $thumbnail,
    int $id,
    string
) {
    // Your code here.
    return $thumbnail;
}

Parameters

  • array|false $thumbnail The image URL, or false if no image is available.
  • int $id The attachment ID.
  • string $image_size The image size to retrieve. Set to 'large' by default. Other variable names: $image_size

Files

\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
		)

← All Hooks

Users

Developers

Clone this wiki locally