[wp-hackers] Using Media Library "selector" on user-edit page
lionel.pointet at globalis-ms.com
Fri May 11 12:35:13 UTC 2012
I think you could simply send an empty post_id to the media-upload script :
The warning won't show and you'll still get the functionality.
But maybe is there a better way to call this window, I can't tell.
2012/5/11 Robert Lusby <nanogwp at gmail.com>
> I've added a custom field text input to my user edit pages in the admin
> area, for an image.
> At present the process is upload image to media library, get url, go to
> user edit, copy+paste URL into the correct text input.
> I want to speed this up by opening the Media Library "selector", like you
> can in custom post types. I've used a common bit of code found while
> Googling for doing this, the Media Library selector opens, however throws
> the following error:
> *Notice*: Undefined index: post_id in *C:\wamp\www\sprkle-com\trunk\**
> httpdocs\wp-admin\includes\**media.php* on line *1481
> Obviously I suspect this is because I'm calling the Media Library selector
> from the user edit screen, rather than a post screen, but is there a way
> around this?
> What's the correct way of opening the Media Library selcetor from the user
> edit screen?
> Code used:
> wp-hackers mailing list
> wp-hackers at lists.automattic.**com <wp-hackers at lists.automattic.com>
More information about the wp-hackers