action to update menu_order to database
-
We’re using Category Order and Taxonomy Terms Order to sort groups of posts, and the order is saved so clearly the ajax script works. However, when we installed about a year ago we had a function to save the order to the database menu_order column. That stopped working. Do you have a suggestion for a function that will work to post the menu_order values?
Here’s my old function that stopped working:
add_action ( ‘wp_ajax_save_menu_order’, ‘menu_order_save’ );
function menu_order_save () {
global $wpdb;
$wpdb->flush ();
$item_id = $_POST[‘post_id’];
$meta_key = ‘_menu_order’;$int = preg_replace(“/[^0-9]/”, “”, $_POST[‘order’]);
update_post_meta ( $item_id, $meta_key, array ( ‘menu_order’ => $int ) );
$response = ‘
Post order updated’;
echo $response;die(0);
}The page I need help with: [log in to see the link]
- The topic ‘action to update menu_order to database’ is closed to new replies.