WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Plugin Admin Page Sortable Metaboxes (2 posts)

  1. Hello,

    I have successfully created my metaboxes and they are opening/closing and dragging properly.

    However, they will NOT save their positions (or open/close status) when refreshing the page.

    I have read about using various enqueue scripts, nonces, and custom javascript... but I am at a loss. I feel I am so close, and just missing some code somewhere.

    Can someone point me to how WordPress saves the sortable metaboxes?

    Here is a snippet of my code:
    http://pastebin.com/uxrJVAMw

    I have also read it's necessary to call the add_metabox from outside the add_options_page function. But when I do this, the metabox disappears from my plugin page.

    Thank you very much to anyone who can help.

    UPDATE: I am using the following code (I picked up somewhere).

    <form action="" method="">
              <?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false ); ?>
              <?php wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false ); ?>
              <input type="hidden" name="action" value="save_dashboard_settings" />
    </form>

    ... as well as the wp_enqueue_script('dashboard'); command.

  2. I got it working. I decided to completely re-write my admin page to take advantage of the "screen-options" tab at the top of the screen.

    Thanks though.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.