PHP function to insert a custom or personalised widget in WordPress Admin Dashboard
<?php /*-------------------------------------------------------------- INSERT LINK TO THE WP TOOLBAR --------------------------------------------------------------*/ function btwp_insert_custom_toolbar_link($wp_admin_bar) { $args = array( 'id' => 'andersonn', 'title' => 'Andersonn', 'href' => 'https://github.com/theandersonn', 'meta' => array( 'class' => 'andersonn', 'title' => 'Andersonn' ) ); $wp_admin_bar->add_node($args); } add_action('admin_bar_menu', 'btwp_insert_custom_toolbar_link', 999);
Tags: wp, wordpress, dashboard, php, add_action, admin_bar_menu, custom_toolbar_link