Skip to content

Instantly share code, notes, and snippets.

@billerickson
Last active February 12, 2018 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/9c6d9cafd18c093d7961cd350ef2c399 to your computer and use it in GitHub Desktop.
Save billerickson/9c6d9cafd18c093d7961cd350ef2c399 to your computer and use it in GitHub Desktop.
<?php // don't include this
/**
* Alphabetically sort subpages
*
* @link http://www.billerickson.net/code/subpages-widget-alphabetical-order/
* @author Bill Erickson
*
* @param array $args, query arguments
* @return array $args
*/
function ea_alphabetically_sort_subpages( $args ) {
$args['sort_column'] = 'post_title';
$args['sort_order'] = 'ASC';
return $args;
}
add_filter( 'be_subpages_widget_args', 'ea_alphabetically_sort_subpages' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment