Instead of editing the core code, one solution is to filter in your new code via action hook:
https://codex.wordpress.org/Plugin_API/Action_Reference
Another option, have additional stylesheet in your theme and properly enqueue it. There’s plenty plugins and tutorials out there that do it for the wp-admin pages. I do admin css like this:
<?php
/**
* Plugin Name: WP Admin CSS
* Description:
* Version:
*/
//First solution : one file
add_action( 'admin_enqueue_scripts', 'load_admin_style' );
function load_admin_style() {
// wp_register_style( 'admin_css', get_template_directory_uri() . '/admin-style.css', false, '1.0.0' );
//OR
wp_enqueue_style( 'admin_css', get_stylesheet_directory_uri() . '/admin-style.css', false, '1.0.0' );
}
/*
//Second solution : two or more files.
add_action( 'admin_enqueue_scripts', 'load_admin_styles' );
function load_admin_styles() {
wp_enqueue_style( 'admin_css_foo', get_template_directory_uri() . '/admin-style-foo.css', false, '1.0.0' );
wp_enqueue_style( 'admin_css_bar', get_template_directory_uri() . '/admin-style-bar.css', false, '1.0.0' );
}
*/
?>
Thread Starter
MikeRW
(@mikerw)
Thanks for the reply however this still doesn’t help. I’m already using login_enqueue_scripts to load a login.css stylesheet for the login page. The problem I have is the logout confirmation page you receive when not using the nonce token. I haven’t been able to find a hook to include the stylesheet. So far the only way I’ve been able to accomplish this is to modify the core file. I’ve looked at the documentation you linked several times and do not see anything useful in this case. Am I missing something?
In some sense every action already added within the core is a hook. Via plugin or theme file functions.php, any action can be removed, and a substitute action added in its place.
In a similar sense every function is a hook.
http://codex.wordpress.org/Function_Reference/remove_action
<?php remove_action( $tag, $function_to_remove, $priority ); ?>
http://codex.wordpress.org/Function_Reference/add_action
<?php add_action( $hook, $function_to_add, $priority, $accepted_args ); ?>