Skip to content

Instantly share code, notes, and snippets.


Darrin dboutote

View GitHub Profile
JeffMatson / get_actions.php
Last active Feb 7, 2016
Prints the actions fired in WordPress, and how many times
View get_actions.php
add_action( 'shutdown', function(){
foreach( $GLOBALS['wp_actions'] as $action => $count )
printf( '%s (%d) <br/>' . PHP_EOL, $action, $count );
mannieschumpert / gist:8886289
Last active Aug 2, 2020
Code Examples from Andrew Nacin's "Current User Can Watch This Talk"
View gist:8886289
// If you can edit pages, you can edit widgets
add_filter( 'user_has_cap',
function( $caps ) {
if ( ! empty( $caps['edit_pages'] ) )
$caps['edit_theme_options'] = true;
return $caps;
} );
You can’t perform that action at this time.