I have a situation in which I am building a plugin that is intentionnally fit for a particular theme. Within my theme I have the following folder structure leading to my css file.
wp-content -> themes -> my-theme-name -> css -> my-custom-css.css
from my plugin, how can I enqueue that template css file onto a specific settings page (FYI - I am currently using the settings API to built my settings page?).
I'm finding tutorials online on how to associate a plugin's style-sheet to the admin area, and that's cool. But I need my theme's custom css file to be enqueued to my custom settings page instead.
Here is something I found in the codex...
Can I do this for a particular settings page?
function wpdocs_enqueue_custom_admin_style() {
wp_register_style( 'custom_wp_admin_css', get_template_directory_uri() . '/admin-style.css', false, '1.0.0' );
wp_enqueue_style( 'custom_wp_admin_css' );
}
add_action( 'admin_enqueue_scripts', 'wpdocs_enqueue_custom_admin_style' );