Plugin / Add Admin CSS

Scott Reilly

Description

Description

Ever want to tweak the appearance of the WordPress admin pages by hiding stuff, moving stuff around, changing fonts, colors, sizes, etc? Any modification you may want to do with CSS can easily be done via this plugin.

Using this plugin you’ll easily be able to define additional CSS (inline and/or files by URL) to be added to all administration pages. You can define CSS to appear inline in the admin head (within style tags), or reference CSS files to be linked (via “link rel=’stylesheet'” tags). The referenced CSS files will appear in the admin head first, listed in the order defined in the plugin’s settings. Then any inline CSS are added to the admin head. Both values can be filtered for advanced customization (see Advanced section).

Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage

Hooks

The plugin exposes two filters for hooking. Typically, code making use of filters should ideally be put into a mu-plugin or site-specific plugin (which is beyond the scope of this readme to explain). Bear in mind that the features controlled by these filters are also configurable via the plugin’s settings page. These filters are likely only of interest to advanced users able to code.

c2c_add_admin_css (filter)

The ‘c2c_add_admin_css’ filter allows customization of CSS that should be added directly to the admin page head.

Arguments:

  • $css (string): CSS styles.

Example:

/**
 * Add CSS to admin pages.
 *
 * @param string $css String to be added to admin pages.
 * @return string
 */
function my_admin_css( $css ) {
    $css .= "
        #site-heading a span { color:blue !important; }
        #favorite-actions { display:none; }
    ";
    return $css;
}
add_filter( 'c2c_add_admin_css', 'my_admin_css' );

c2c_add_admin_css_files (filter)

The ‘c2c_add_admin_css_files’ filter allows programmatic modification of the list of CSS files to enqueue in the admin.

Arguments:

  • $files (array): Array of CSS files.

Example:

/**
 * Add CSS file(s) to admin pages.
 *
 * @param array $files CSS files to be added to admin pages.
 * @return array
 */
function my_admin_css_files( $files ) {
    $files[] = 'http://yui.yahooapis.com/2.9.0/build/reset/reset-min.css';
    return $files;
}
add_filter( 'c2c_add_admin_css_files', 'my_admin_css_files' );

DIRECTORY DISCLAIMER

The information provided in this THEME/PLUGIN DIRECTORY is made available for information purposes only, and intended to serve as a resource to enable visitors to select a relevant theme or plugin. wpSocket gives no warranty of any kind, express or implied with regard to the information, including without limitation any warranty that the particular theme or plugin that you select is qualified on your situation.

The information in the individual theme or plugin displayed in the Directory is provided by the owners and contributors themselves. wpSocket gives no warranty as to the accuracy of the information and will not be liable to you for any loss or damage suffered by you as a consequence of your reliance on the information.

Links to respective sites are offered to assist in accessing additional information. The links may be outdated or broken. Connect to outside sites at your own risk. The Theme/Plugin Directory does not endorse the content or accuracy of any listing or external website.

While information is made available, no guarantee is given that the details provided are correct, complete or up-to-date.

wpSocket is not related to the theme or plugin, and also not responsible and expressly disclaims all liability for, damages of any kind, arising out of the use, reference to, or reliance on, any information or business listed throughout our site.

Keep Leading Your Followers!
Share it for them.