Here’s a quick and simple one that many of you might not know. This helps dramatically if you want to better match your UI with the current color scheme being used in the WordPress admin dashboard.

function build_admin_colors() {
    global $_wp_admin_css_colors;

    $current_color_scheme = get_user_meta( get_current_user_id(), 'admin_color', true );

    $colors = array_merge(
        $_wp_admin_css_colors[ $current_color_scheme ]->colors,
        $_wp_admin_css_colors[ $current_color_scheme ]->icon_colors

    return $colors;

When running this snippet, you’ll get an array containing the hex codes for the current colors and icon colors that are currently in use. Just call that function when you need it.

I’ve decided to begin offering quick code snippets every day. These can range, but will likely be mostly WordPress and PHP. ┬áThis first code snippet will allow you to see all of the actions fired within a particular request in WordPress.

add_action( 'shutdown', function(){
    foreach( $GLOBALS['wp_actions'] as $action => $count )
        printf( '%s (%d) <br/>' . PHP_EOL, $action, $count );

Just toss that in any PHP file that you know will be firing on the desired page, and you’re good to go. Have a better solution? Let me know in the comments below.