Here's the scenario:
In my plugin, I want to have a metabox show up on the post / page editor.
I want the metabox to be -exactly- like WordPress' 'Custom Fields' metabox, ( Add another, delete, update, auto-populated dropdown, Enter new link, AJAX magic, etc ); with a couple minor differences:
Instead of just 'Name' and 'Value', I want 'Target', 'Name' and 'Value'
Instead of saving them all as 'public' custom fields that automatically appear inside the WP Custom Fields metabox, I want them all stored as a single multidimensional array inside a 'private', namespaced, field...i.e.,
_myplugin_custom_fields = array( 1 => array( 'target' => 'mytarget1', 'name' => 'myname1', 'value' => 'myvalue1' ), 2 => array( 'target' => 'mytarget2', 'name' => 'myname2', 'value' => 'myvalue2' ) )
I've spent all day digging through the tangled web of WP Core, and have not been able to find a straightforward way to pull this off. If I move forward based on my current understanding, I'll end up duplicating hundreds of lines of core code from numerous php and js files.
Can anyone here in WordPress Answers-land help point me in the right direction? I have plenty of experience in adding and leveraging metaboxes within themes and plugins, but this one has me totally stumped.
Please speak up if I'm being unclear.
Thanks in advance to all who reply!