Customizing Wordpress's Media Library -- should I use a hook?
April 20, 2011 4:44 PM Subscribe
Question about Wordpress plugins and hooks.
posted by Victorvacendak to Computers & Internet (4 answers total) 2 users marked this as a favorite
I've been trying to write code to add a new, clickable option to the Wordpress Media Library. The idea is 1) to let the user choose a picture, and then automatically 2) do stuff with that picture. (For example, assigning that picture's URL to a custom field.)
After reading the Wordpress Codex and various other people's plugins, here is what I am confused about: OK, so I have successfully added a link to the Media Gallery, "do stuff with this picture." And so it is all ready to send GET info to a PHP function, somewhere.
But where? I don't know how to make that info go to a hook that I can hang a function on, or to some other PHP that can deal with it.
I'm still learning the Hook system, and I'm wondering if there is a nice Hook that would handle a situation like this through add_action. If I only knew which hook that was, or, if this isn't the best solution, what other method you might suggest for letting a user click on the Dashboard to reach a new function to handle his/her input.
I thought about just creating a separate form-handling PHP script but wasn't sure if this was proper Wordpress programming form.
Any help much appreciated.