_sort_name_callback

Callback to sort array by a 'name' key.

Description

(int) _sort_name_callback( $a, $b ); 

Returns (int)

Parameters (2)

0. $a
The a.
1. $b
The b.

Usage

  1. if ( !function_exists( '_sort_name_callback' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/widgets.php'; 
  3.  
  4. // The a. 
  5. $a = null; 
  6.  
  7. // The b. 
  8. $b = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = _sort_name_callback($a, $b); 
  12.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/widgets.php  
  1. function _sort_name_callback( $a, $b ) { 
  2. return strnatcasecmp( $a['name'], $b['name'] );