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

Andrew Nacin wp at andrewnacin.com
Thu Jun 16 14:27:44 UTC 2011


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().


More information about the wp-hackers mailing list