[wordpress插件] Add Admin CSS添加管理员CSS

wordpress 插件 文章 2020-01-29 09:40 496 0 全屏看文

AI助手支持GPT4.0

评分

98

98

描述

Ever want to tweak the appearance of the WordPress admin pages by hiding stuff, moving stuff around, changing fonts, colors, sizes, etc?

是否曾经想通过隐藏内容,移动内容,更改字体,颜色,大小等来调整WordPress管理页面的外观?

Any modification you may want to do with CSS can easily be done via this plugin.

您可以通过此插件轻松地对CSS进行任何修改。

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.

使用该插件,您可以轻松定义要添加到所有管理页面的其他CSS(内联和/或URL文件)。

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).

您可以定义CSS在管理头中内联显示(在样式标签内),或引用要链接的CSS文件(通过“ link rel ='stylesheet'”标签)。

The referenced CSS files will appear in the admin head first, listed in the order defined in the plugin’s settings.

引用的CSS文件将首先出现在管理头中,并按照插件设置中定义的顺序列出。

Then any inline CSS are added to the admin head.

然后,将任何内联CSS添加到管理头。

Both values can be filtered for advanced customization (see Advanced section).

可以过滤这两个值以进行高级定制(请参阅“高级”部分)。

Links: Plugin Homepage |

链接:插件主页 |

Plugin Directory Page |

插件目录页面 |

GitHub |

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).

通常,理想情况下,应该将使用过滤器的代码放入mu插件或特定于站点的插件中(这不在本自述文件的解释范围内)。

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)

c2c_add_admin_css(过滤器)

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

“ c2c_add_admin_css”过滤器允许自定义CSS,该CSS应该直接添加到管理页面的头部。

Arguments:

参数:

    • $css (string): CSS styles.
    • $ css(字符串):CSS样式。

    Example:

    示例:

    /** 

      / ** 

    * Add CSS to admin pages. 

    *将CSS添加到管理页面。 

    * @param string $css String to be added to admin pages. 

    * @param string $ css要添加到管理页面的字符串。 

    * @return string 

    * @返回字符串 

    */

    * /

    function my_admin_css( $css ) {    

    函数my_admin_css($ css){    

    $css .= "        

    $ css。=“        

    #site-heading a span { color:blue !important;

    #site-heading span {{color:blue!important;

    }        

    }        

    #favorite-actions { display:none;

    #favorite-actions {display:none;

    }    

    }    

    ";    

    “;    

    return $css;

    返回$ css;

    }

    }

    add_filter( 'c2c_add_admin_css', 'my_admin_css' );

    add_filter('c2c_add_admin_css','my_admin_css');

    c2c_add_admin_css_files (filter)

    c2c_add_admin_css_files(过滤器)

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

    通过“ c2c_add_admin_css_files”过滤器,可以以编程方式修改CSS文件列表,以使其进入管理员名单。

    Arguments:

    参数:

      • $files (array): Array of CSS files.
      • $ files(数组):CSS文件的数组。

      Example:

      示例:

      /** 

        / ** 

      * Add CSS file(s) to admin pages. 

      *将CSS文件添加到管理页面。 

      * @param array $files CSS files to be added to admin pages. 

      * @param array $ files要添加到管理页面的CSS文件。 

      * @return array 

      * @返回数组 

      */

      * /

      function my_admin_css_files( $files ) {    

      函数my_admin_css_files($ files){    

      $files[] = 'http://yui.yahooapis.com/2.9.0/buildeseteset-min.css';    

      $ files [] ='http://yui.yahooapis.com/2.9.0/buildeseteset-min.css';    

      return $files;

      返回$ files;

      }

      }

      add_filter( 'c2c_add_admin_css_files', 'my_admin_css_files' );

      add_filter('c2c_add_admin_css_files','my_admin_css_files');

安装步骤

    1. Install via the built-in WordPress plugin installer.

    2. 通过内置的WordPress插件安装程序进行安装。

      Or download and unzip add-admin-css.zip inside the plugins directory for your site (typically wp-content/plugins/)

    3. 或在您网站的插件目录中下载 add-admin-css.zip 并解压缩(通常为 wp-content / plugins /

    4. Activate the plugin through the ‘Plugins’ admin menu in WordPress
    5. 通过WordPress中的“插件”管理菜单激活插件

    6. Go to “Appearance” -> “Admin CSS” and specify some CSS to be added into all admin pages.

    7. 转到“外观”->“管理CSS”,然后指定要添加到所有管理页面的一些CSS。

      (You can also use the “Settings” link in the plugin’s entry on the admin “Plugins” page).

    8. (您也可以使用管理员“插件”页面上插件条目中的“设置”链接。)

下载地址

https://downloads.wordpress.org/plugin/add-admin-css.1.8.zip

https://downloads.wordpress.org/plugin/add-admin-css.1.8.zip

-EOF-

AI助手支持GPT4.0