Skip to content

Instantly share code, notes, and snippets.

@lloc
Last active March 21, 2018 17:09
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 lloc/2134a8da5107bf48e81999821e7835ea to your computer and use it in GitHub Desktop.
Save lloc/2134a8da5107bf48e81999821e7835ea to your computer and use it in GitHub Desktop.
<?php
// Sort an array of objects by name
usort( $arr, function ( $a, $b ) {
return strcmp( $a->name, $b->name );
} );
function callback_function_name() {
// do something
}
add_action( 'action_name', 'callback_function_name' );
add_action( 'action_name', function() {
// do something
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment