wp_lib_settings_page - roberts-sandbox/create-repo GitHub Wiki
This action hook allows developers to enqueue their own scripts and styles on the WP-Librarian settings page. Assets can be loaded on specific settings page tabs or on all of them.
###Context
This hook is called near the top of the settings page template file. Having reached this hook implies that the user is at least a Library Admin, or has been given the wp_lib_change_settings WordPress capability by some other means.
###Parameters
$tab
The current settings tab the user is on. If an empty string is given the user has requested the default tab (General)
###Example
Suppose you have already registered a scriptmy-settings-script you want to use on your settings page tab my_tab, that you set up earlier. You would use the following code:
add_action('wp_lib_settings_page', 'enqueue_my_tab_scripts', 10, 1);
function enqueue_my_tab_scripts($tab) {
if ($tab === 'my_tab')
wp_enqueue_script('my-settings-script');
}