Tag Info

Hot answers tagged

2

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


2

You could use ajax and the admin_footer-post-new.php hook. The sql would vary depending on whether you want the highest or most recently published order number. The following returns the highest published order number + 1: function wpse155926_set_menu_order() { $ret = array(); if ( check_ajax_referer( 'wpse155926_set_menu_order_post', 'nonce', ...



Only top voted, non community-wiki answers of a minimum length are eligible