greets. i'm looking to modify a few functions contained within admin/includes/media.php. i've already modified this file to accommodate my goals, but would prefer to move it into a plugin in order to keep the core clean (updateable too).
goal is basically to have a couple of extra fields in the image information area, after one has been uploaded. it already includes img title, caption, description, etc. my mod adds a checkbox to it and a sort-order field, using existing post fields. and the form handler needs to be able to update those fields and write an XML file based on those results.
so here's the functions i've modified in media.php:
- this is where the bulk of work is done. this handles the "Save Changes" button. in the foreach-attachment, i've added a couple fields before it writes the data to the DB. also here's where the xml file gets written.
- this is where the actual form fields are identified and populated. here i've added a checkbox and a text field.
- i'll add some text here near the buttons. bit of a luxury, so i'm not so worried about this one really.
so what i'm hoping is that i can just re-write those two/three functions MY way, then make wordpress use the new functions. i've gotten as far as the bit at the bottom of the script where it adds filter and actions, but there's a tree-thing happening with the functions, where first there's
get_media_item then calls
so i was thinking maybe that that's where i'd be starting from - remove that filter, and then apply my own, and re-create that whole customized function tree in my plugin. and get_media_item is also referenced by get_media_items (plural), so if i mod it, i want get_media_items to pick up on the new reference also.
so i'm a bit confused about all of this, and sorry for not giving line numbers, my file is off because of my mods. i've indeed googled quite a good bit, but nothing easy floated to the surface. thanks much.