
內容簡介
想要透過隱藏、移動、改變字體、顏色、大小等方法調整 WordPress 管理頁面的外觀嗎?透過這個外掛,您可以輕鬆地定義額外的 CSS(包括行內 CSS 和來自 URL 的 CSS 檔案),以便在所有管理頁面上加入。您可以定義顯示在管理頁面 head 標籤中的行內 CSS(在 style 標籤中),或是參照 CSS 檔案進行連結(透過「link rel='stylesheet'」標籤)。這些 CSS 檔案會首先顯示在管理頁面 head 標籤中,並按照外掛設定中所定義的順序進行排序。然後加入任何行內 CSS。這兩個值都可以進行進階自訂(請參閱進階部分)。
連結:外掛首頁 | 外掛目錄頁面 | GitHub | 作者首頁
鉤子(Hooks)
本外掛提供兩個用於掛鉤的過濾器。通常,使用過濾器的程式碼最好放在 mu-plugin 或特定網站的外掛中(這不在本自述檔範圍之內)。請注意,這些過濾器控制的功能也可以透過外掛設定頁進行設置。這些過濾器可能只對能夠編寫的進階用戶有興趣。
c2c_add_admin_css(過濾器)
“c2c_add_admin_css”過濾器允許自定義 CSS,以直接添加到管理頁面 head。
參數:
$css(字串):CSS 樣式。
範例:
/**
* 添加 CSS 到管理頁面。
*
* @param string $css 要添加到管理頁面的字串。
* @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(過濾器)
“c2c_add_admin_css_files”過濾器允許以編程方式修改要在管理中排隊的 CSS 文件列表。
參數:
$files(數組):CSS 文件的數組。
範例:
/**
* 添加 CSS 文件到管理頁面。
*
* @param array $files 要添加到管理頁面的 CSS 檔案。
* @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' );
外掛標籤
開發者團隊
原文外掛簡介
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' );
