Get list of all registered scripts and styles in WP

Another one for the future references.

global $enqueued_scripts;
global $enqueued_styles;

add_action( 'wp_print_scripts', 'cyb_list_scripts' );
function cyb_list_scripts() {
    global $wp_scripts;
    global $enqueued_scripts;
    $enqueued_scripts = array();
    foreach( $wp_scripts->queue as $handle ) {
        $enqueued_scripts[] = $wp_scripts->registered[$handle]->src;
    }
}

add_action( 'wp_print_styles', 'cyb_list_styles' );
function cyb_list_styles() {
    global $wp_styles;
    global $enqueued_styles;
    $enqueued_styles = array();
    foreach( $wp_styles->queue as $handle ) {
        $enqueued_styles[] = $wp_styles->registered[$handle]->src;
    }
}

Print somewhere:

    global $enqueued_scripts;
    var_dump( $enqueued_scripts );
    global $enqueued_styles;
    var_dump( $enqueued_styles );

Thanks to @cybmeta at stack overflow.

Published Simple shortcode buttons

I’ve completed my first official WP plugin, available here:¬†https://wordpress.org/plugins/simple-shortcode-buttons/
You can read more about it here: http://davidp.net/simple-shortcode-buttons/.

It’s basically a WordPress editor (TinyMCE) button generator, that makes inserting shortcodes into text painless. I’ve been using it on some of my projects lately and it has proven to be really useful, so I took some¬†time and made it official, so everyone can use it now.