Closed Screenfeed closed 10 years ago
Can't you use the post_id
variable set in HEAD by the admin for this?
Nope, $GLOBALS['post_id']
or $GLOBALS['post_ID']
are not set in admin-ajax.php.
Sorry, I had assumed you were talking about js access to it.
In my case, I need the post type inside the filter 'image_size_names_choose'
, which is used in the media modal. The only way to have it is by using $_POST['post_id']
, but $_POST['post_id']
is only sent if we specify it in the wp_enqueue_media()
parameters.
I'll have a release out and publish to .org soon.
Thanks :)
Hi,
In your
enqueue_admin_scripts()
method you usewp_enqueue_media()
but you omit to specify the post ID. It's a problem if a script or a plugin needs that ID in the media window. Solution:Thanks. Greg