Skip to content

Instantly share code, notes, and snippets.

@wplit
Last active June 20, 2019 04:51
Show Gist options
  • Save wplit/fa5e9de899f093a7ed26cdba564db277 to your computer and use it in GitHub Desktop.
Save wplit/fa5e9de899f093a7ed26cdba564db277 to your computer and use it in GitHub Desktop.
Adds quick link to resign shortcodes in admin bar, useful when moving between staging - dev areas when using Oxygen
add_action( 'admin_bar_menu', 'lit_resign_adminbar_item', 1002 );
/**
* Adds "Resign" menu item in the WordPress admin bar.
*
* @param WP_Admin_Bar $admin_bar WP_Admin_Bar instance, passed by reference.
*/
function lit_resign_adminbar_item( $admin_bar ) {
if( !class_exists( 'CT_Component' ) ) {
return;
}
$admin_bar->add_menu(
array(
'id' => 'resign',
'title' => 'Resign',
'href' => admin_url( 'admin.php?page=oxygen_vsb_sign_shortcodes' ),
'meta' => array(
'title' => __( 'Oxygen Resign Shortcodes' ),
),
)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment