Home / Admin / Order WPCode snippets by title in the admin
Duplicate Snippet

Embed Snippet on Your Site

Order WPCode snippets by title in the admin

Make the default order of WPCode snippets in the admin by title ascending.

<10
Code Preview
php
<?php
add_filter( 'wpcode_code_snippets_table_prepare_items_args', function( $args ) {
	if ( ! isset( $_GET['orderby'] ) ) {
		$args['orderby'] = 'title';
	}
	if ( ! isset( $_GET['order'] ) ) {
		$args['order'] = 'ASC';
	}
	
	return $args;
});

Comments

Add a Comment