The administration part for my plugin is divided into several pages and for some pages I would like to enqueue a JS source which would add jQuery functionality to various elements.
Right now this is my approach:
function admin_register_init() {
if ($_GET['page'] == 'worldexplorer_admin_location_hub')
wp_enqueue_script('worldexplorer_admin_hub', WP_PLUGIN_URL.'/worldexplorer/admin/admin_hub.js');
}
add_action('admin_init', 'admin_register_init');
However, this requires me to check the page index of the $_GET array. Is there another way to achieve what I wish to do?