[wp-hackers] Drag and drop panels in plugin's page

due chiacchiere info at duechiacchiere.it
Thu Jun 16 14:34:03 UTC 2011


Andrew,

according to the Codex, those functions only work on some admin pages:

Theadd_meta_box()function was introduced inVersion 2.5 
<http://codex.wordpress.org/Version_2.5>. It allows plugin developers to 
add sections to the Write Post, Write Page, and Write Link editing pages.

http://codex.wordpress.org/Function_Reference/add_meta_box

I want to create "movable" boxes in a new custom page generated by my 
plugin. Is there something I'm missing here?

Thanks,
Dino.

On 6/16/2011 10:27 AM, Andrew Nacin wrote:
> On Thu, Jun 16, 2011 at 9:37 AM, Dino Termini<dino at duechiacchiere.it>wrote:
>
>> Hi Helen and all,
>>
>> sorry for the very late reply to your message. I got involved into a
>> project and of course your request to share my method to "move panels
>> around" in Wordpress using Jquery slipped through the cracks. But now here I
>> am, so get ready to learn this new technique :)
>>
>> 1. Add a new page to the admin interface, like you had explained with the
>> function "yourprefix_help_page", using the HTML structure you described.
>> Note the ID's associated to each box (p1, p2, etc):
>>
>> <div class="wrap">
>> <h2>I like to move it, move it</h2>
>> <div class="meta-box-sortables ui-sortable">
>> <div class="postbox" id="p1">
>> <h3 class="hndle">Drag me around, babe</h3>
>> <div class="container">
>> <p>Your content goes here</p>
>> </div>
>> </div><!-- .postbox -->
>> <div class="postbox" id="p2">
>> <h3 class="hndle">Drag me, too</h3>
>> <div class="container">
>> <p>Your content goes here, again</p>
>> </div>
>> </div><!-- .postbox -->
>> </div><!-- .meta-box-sortables.ui-sortable-->
>> </div><!-- .wrap -->
>
>
>
> You really don't need (and absolutely should not) do all of that. You
> shouldn't do any of that.
>
> Rather, use the core API, in particular add_meta_box() and do_meta_boxes().
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers


More information about the wp-hackers mailing list