Batch update menu_order attribute alphabetically

Is there a way to batch update the page order attribute of all children of a specific parent, each time a new child is added?

More simply, is there a way to loop through pages and change the sort attribute so they are alphabetical?

For instance….

  • Page Title A – sort order 0
  • Page Title C – sort order 0
  • Page Title B – sort order 0

Would become…

  • Page Title A – sort order 1
  • Page Title C – sort order 3
  • Page Title B – sort order 2

And would ultimately be displayed in the admin as…

  • Page Title A – sort order 1
  • Page Title B – sort order 2
  • Page Title C – sort order 3

Solutions Collecting From Web of "Batch update menu_order attribute alphabetically"