[wp-hackers] Custom post type and media upload tabs
barry at multipop.org
Wed Mar 2 18:04:44 UTC 2011
There seems to be a $_GET['post_id'] available.
You could check the post type for that id with get_post_type( $_GET['post_id'] ).
On 2 Mar, 2011, at 18:54 , Olivier wrote:
> I am trying to play with media upload tabs in the custom post type
> edition page.
> I'd like to hide the library and gallery tabs for some users. So I
> have hooked on :
> And then my filtering code :
> function custom_media_upload_tabs($tabs)
> Now I'd like to make a segregation between my custom post type and
> regular post type so that gallery and library display still appear on
> regular post type.
> The issue is that when the media upload thickbox is loaded, the
> $_GET['post_type'] and $_GET['post'] aren't filled anymore. Therefore,
> I can't verify if I am on a regular post or a custom post type to fire
> my filter or not.
> Is anyone aware of another global var that I could test?
> Thanks a lot!
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers