Plugin admin page meta_box toggle and order state not saving

I can’t get the toggle state and open/close status of meta_boxes on my plugin admin page to be stored. The ajax response is always 0

I’m using meta boxes to hold sections of menu for a plugin.

Read More
wp_enqueue_script( 'common' );
wp_enqueue_script( 'wp-lists' );
wp_enqueue_script( 'postbox' );

are called on an init add_action hook

add_meta_boxes are called with admin_menu add_action hook
Then the admin page for my plugin is rendered thus…

<div class="wrap" id="church-admin">
<div id="icon-index" class="icon32"><br/></div><h2>Church Admin Plugin</h2>
<div id="poststuff">
    <!-- #post-body .metabox-holder goes here -->
    <div id="post-body" class="metabox-holder columns-2">
        <!-- meta box containers here -->
        <form style="display:none" method="get" action="">
            <?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false ); ?>
            <?php wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false ); ?>
        </form>
        <?php do_meta_boxes('church-admin','advanced',null);?>
    </div>
</div>
</div>
<script type="text/javascript">
jQuery(document).ready(function($){$(".if-js-closed").removeClass("if-js-closed").addClass("closed");
            postboxes.add_postbox_toggles( pagenow );
            });
</script>

Why are opn/close toggles and order changes not saved?

Related posts

Leave a Reply

1 comment