Skip to content

wpt_post_attachment

github-actions[bot] edited this page Jun 20, 2026 · 5 revisions

Filter the attachment ID to post with a status update.

Auto-generated Example

add_filter(
   'wpt_post_attachment',
    function(
        int $attachment_id,
        int $post_ID
    ) {
        // Your code here.
        return $attachment_id;
    },
    10,
    2
);

Parameters

  • int $attachment_id Attachment ID.
  • int $post_ID Post ID.

Returns

int|bool

Files

apply_filters( 'wpt_post_attachment', $attachment_id, $post_ID )

← All Hooks

Clone this wiki locally