Answers for "add admin menu link custom wp"

PHP
0

add admin menu link custom wp

add_action( 'admin_menu', 'register_custom_menu_link' );
/**
 * @author    Brad Dalton
 * @example   http://wpsites.net/wordpress-admin/add-top-level-custom-admin-menu-link-in-dashboard-to-any-url/
 * @copyright 2014 WP Sites
 */
function register_custom_menu_link(){
    add_menu_page( 
      'custom menu link', 
      'Your Menu Link', 
      'manage_options', 
      'any-url', 
      'wpsites_custom_menu_link', 
      'dashicons-external', 3
    ); 
}

function wpsites_custom_menu_link(){
    wp_redirect( 'http://www.example.com', 301 ); 
	exit;
}
Posted by: Guest on April-14-2020

Browse Popular Code Answers by Language