Skip to content

wpt_upload_media

github-actions[bot] edited this page Jun 14, 2026 · 1 revision

Filter whether this post should upload media.

Auto-generated Example

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

Parameters

  • bool $upload True to allow this post to upload media.
  • int $post_ID Post ID.

Returns

bool

Files

apply_filters( 'wpt_upload_media', $return, $post_ID )

← All Hooks

Clone this wiki locally