Tag Info

New answers tagged

0

You could use ajax and the admin_footer-post-new.php hook. The sql would vary depending on what you mean by last order number - last published or highest or whatever: function wpse155926_set_menu_order() { $ret = array(); if ( check_ajax_referer( 'wpse155926_set_menu_order_post', 'nonce', false /*die*/ ) ) { global $wpdb; //highest ...


0

You could hook into the publish_page transitional status action and use a simple SQL query (via $wpdb) to determine the highest current value of menu_order in the {prefix}_posts table and set the menu_order of the new page accordingly. Example code: add_action( 'publish_page', 'wpse155926_set_to_last_page', 10, 2 ); function wpse155926_set_to_last_page( ...


0

An alternative, at least, is to use this plugin: Auto Submenu WordPress can only automatically add new top-level pages to menus. With Auto Submenu, new child pages will also be automatically added to menus.



Top 50 recent answers are included