Skip to content

Instantly share code, notes, and snippets.

Avatar

Darrin dboutote

View GitHub Profile
@JeffMatson
JeffMatson / get_actions.php
Last active Feb 7, 2016
Prints the actions fired in WordPress, and how many times
View get_actions.php
<?php
add_action( 'shutdown', function(){
foreach( $GLOBALS['wp_actions'] as $action => $count )
printf( '%s (%d) <br/>' . PHP_EOL, $action, $count );
});
@mannieschumpert
mannieschumpert / gist:8886289
Last active Aug 2, 2020
Code Examples from Andrew Nacin's "Current User Can Watch This Talk"
View gist:8886289
<?php
// 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.