本文整理汇总了PHP中wp_admin_css_color函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_admin_css_color函数的具体用法?PHP wp_admin_css_color怎么用?PHP wp_admin_css_color使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_admin_css_color函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: register_admin_color_scheme
public function register_admin_color_scheme()
{
global $_wp_admin_css_colors;
wp_admin_css_color('darkadmin', __('DarkAdmin'), plugins_url('css/colors-darkadmin.css', __FILE__), array('#222', '#333', '#0074a2', '#2ea2cc'));
$_wp_admin_css_colors['darkadmin']->icon_colors = array('base' => '#999', 'focus' => '#2ea2cc', 'current' => '#fff');
$this->replace_css('colors', 'colors-darkadmin.css');
}
示例2: collectSchema
/**
* Collect schema from wordpress active theme
*
* @return boolean true on success false if color schema folder is not exists
* in the active theme folder
*/
public function collectSchema()
{
$options = $this->getOptions();
$path = get_template_directory() . $options['path'];
// make sure that the color schema folder exsists
if (!file_exists($path) || !is_dir($path)) {
return;
// just ignore
}
// register the new color schema
$contents = new \DirectoryIterator($path);
foreach ($contents as $content) {
if ($contents->isDot()) {
continue;
}
if ($contents->isDir()) {
$name = $content->getFilename();
$init = parse_ini_file($content->getPathname() . '/schema.ini');
if (!is_array($init)) {
trigger_error('Unbale Admin Color Schema Config File', E_USER_ERROR);
}
$suffix = is_rtl() ? '-rtl' : '';
$url = get_template_directory_uri() . $options['path'] . '/' . $name . "/colors{$suffix}.css";
wp_admin_css_color($name, __(isset($init['name']) && !empty($init['name']) ? $init['name'] : $name, isset($init['domain']) && !empty($init['domain']) ? $init['domain'] : 'default'), $url, isset($init['colors']) && is_array($init['colors']) ? $init['colors'] : array(), isset($init['icons']) && is_array($init['icons']) ? $init['icons'] : array());
}
}
}
示例3: register_scheme
/**
* Register the admin color scheme
*
* @action admin_init
*/
public function register_scheme()
{
$suffix = is_rtl() ? '-rtl' : '';
$suffix .= SCRIPT_DEBUG ? '' : '.min';
$url = add_query_arg(['ver' => static::VERSION], plugins_url("assets/colors{$suffix}.css", __FILE__));
wp_admin_css_color('godaddy', 'GoDaddy', $url, ['#212121', '#77c043', '#008a32', '#f2812e'], ['base' => '#000', 'focus' => '#008a32', 'current' => '#fff']);
}
示例4: admin_init
public function admin_init()
{
$schemes = $this->get_option('schemes', array());
foreach ($schemes as $scheme) {
wp_admin_css_color($scheme['slug'], $scheme['name'], esc_url($scheme['uri']), array($scheme['base_color'], $scheme['icon_color'], $scheme['highlight_color'], $scheme['notification_color']), array('base' => $scheme['icon_color'], 'focus' => $scheme['icon_focus'], 'current' => $scheme['icon_current']));
}
}
示例5: additional_admin_color_schemes
function additional_admin_color_schemes()
{
//Get the theme directory
$theme_dir = get_template_directory_uri();
//Color Template hinzufügen
wp_admin_css_color('hinzkunz', __('Hinz und Kunz'), $theme_dir . '/admin-colors/hinzkunz/colors.css', array('#004c5a', '#004c5a', '#004c5a', '#004c5a'));
}
示例6: mp6_register_admin_color_scheme
function mp6_register_admin_color_scheme()
{
global $wp_styles, $_wp_admin_css_colors;
wp_admin_css_color('mp6', 'MP6', plugins_url('css/colors-mp6.css', __FILE__), array('#222', '#333', '#0074a2', '#2ea2cc'));
$_wp_admin_css_colors['mp6']->icon_colors = array('base' => '#999', 'focus' => '#2ea2cc', 'current' => '#fff');
// set modification time
$wp_styles->registered['colors']->ver = filemtime(plugin_dir_path(__FILE__) . 'css/colors-mp6.css');
// set dependencies
$wp_styles->registered['colors']->deps[] = 'open-sans';
$wp_styles->registered['colors']->deps[] = 'dashicons';
}
示例7: usa_color_schemes
/**
* Register color schemes.
*/
function usa_color_schemes()
{
$suffix = is_rtl() ? '-rtl' : '';
$debug = WP_DEBUG ? '' : '.min';
wp_admin_css_color('open-highway', __('Open Highway', 'admin_schemes'), plugins_url("open-highway/colors{$suffix}{$debug}.css", __FILE__), array('#212121', '#323a45', '#5b616b', '#fdb81e'), array('base' => '#fad980', 'focus' => '#fdb81e', 'current' => '#fdb81e'));
wp_admin_css_color('shenandoah', __('Shenandoah', 'admin_schemes'), plugins_url("shenandoah/colors{$suffix}{$debug}.css", __FILE__), array('#212121', '#494440', '#2e8540', '#4aa564'), array('base' => '#e4e5e7', 'focus' => '#212121', 'current' => '#212121'));
wp_admin_css_color('old-glory', __('Old Glory', 'admin_schemes'), plugins_url("old-glory/colors{$suffix}{$debug}.css", __FILE__), array('#112e51', '#205493', '#0071bc', '#cc2211'), array('base' => '#e1f3f8', 'focus' => '#fff', 'current' => '#fff'));
wp_admin_css_color('from-many-one', __('From Many One', 'admin_schemes'), plugins_url("from-many-one/colors{$suffix}{$debug}.css", __FILE__), array('#212121', '#323a45', '#981b1e', '#9bdaf1'), array('base' => '#f1f1f3', 'focus' => '#9bdaf1', 'current' => '#9bdaf1'));
wp_admin_css_color('nasa', __('NASA', 'admin_schemes'), plugins_url("nasa/colors{$suffix}{$debug}.css", __FILE__), array('#000', '#262626', '#0B3D91', '#FC3D21'), array('base' => '#f1f2f3', 'focus' => '#fff', 'current' => '#fff'));
wp_admin_css_color('nasa-1976', __('NASA 1976', 'admin_schemes'), plugins_url("nasa-1976/colors{$suffix}{$debug}.css", __FILE__), array('#0F1515', '#1e2a29', '#5D824B', '#a7b145'), array('base' => '#f1f3f3', 'focus' => '#fff', 'current' => '#fff'));
}
示例8: add_colors
/**
* Register color schemes.
*/
function add_colors()
{
$suffix = is_rtl() ? '-rtl' : '';
wp_admin_css_color('vinyard', __('Vinyard', 'admin_schemes'), plugins_url("vineyard/colors{$suffix}.css", __FILE__), array('#301D25', '#462b36', '#d3995d', '#eabe3f'), array('base' => '#f1f2f3', 'focus' => '#fff', 'current' => '#fff'));
wp_admin_css_color('primary', __('Primary', 'admin_schemes'), plugins_url("primary/colors{$suffix}.css", __FILE__), array('#282b48', '#35395c', '#f38135', '#e7c03a'), array('base' => '#f1f2f3', 'focus' => '#fff', 'current' => '#fff'));
wp_admin_css_color('80s-kid', __('80\'s Kid', 'admin_schemes'), plugins_url("80s-kid/colors{$suffix}.css", __FILE__), array('#0A3D80', '#0c4da1', '#ed5793', '#eb853b'), array('base' => '#e4e5e7', 'focus' => '#fff', 'current' => '#fff'));
wp_admin_css_color('aubergine', __('Aubergine', 'admin_schemes'), plugins_url("aubergine/colors{$suffix}.css", __FILE__), array('#4c4b5f', '#585a61', '#e87162', '#da9b49'), array('base' => '#e4e4e7', 'focus' => '#fff', 'current' => '#fff'));
wp_admin_css_color('cruise', __('Cruise', 'admin_schemes'), plugins_url("cruise/colors{$suffix}.css", __FILE__), array('#292B46', '#36395c', '#8bbc9f', '#d2ac1f'), array('base' => '#f1f1f3', 'focus' => '#fff', 'current' => '#fff'));
wp_admin_css_color('flat', __('Flat', 'admin_schemes'), plugins_url("flat/colors{$suffix}.css", __FILE__), array('#1F2C39', '#2c3e50', '#1abc9c', '#f39c12'), array('base' => '#f1f2f3', 'focus' => '#fff', 'current' => '#fff'));
wp_admin_css_color('lawn', __('Lawn', 'admin_schemes'), plugins_url("lawn/colors{$suffix}.css", __FILE__), array('#0F1515', '#1e2a29', '#5D824B', '#a7b145'), array('base' => '#f1f3f3', 'focus' => '#fff', 'current' => '#fff'));
wp_admin_css_color('seashore', __('Seashore', 'admin_schemes'), plugins_url("seashore/colors{$suffix}.css", __FILE__), array('#F8F6F1', '#d5cdad', '#7D6B5C', '#456a7f'), array('base' => '#533C2F', 'focus' => '#F8F6F1', 'current' => '#F8F6F1'));
}
示例9: add_color_scheme
/**
* Register the custom admin color scheme
*/
function add_color_scheme()
{
// child theme
if (file_exists(get_stylesheet_directory() . "/admin-color.css")) {
wp_admin_css_color('st', __('Super Thorough', 'st-color-scheme'), get_stylesheet_directory_uri() . '/admin-color.css', array('#474247', '#de1e7e', '#ec76b1', '#d51d79'));
} elseif (file_exists(get_template_directory() . "/admin-color.css")) {
// parent theme
wp_admin_css_color('st', __('Super Thorough', 'st-color-scheme'), get_template_directory_uri() . '/admin-color.css', array('#474247', '#de1e7e', '#ec76b1', '#d51d79'));
} else {
// plugin
wp_admin_css_color('st', __('Super Thorough', 'st-color-scheme'), plugins_url('st-admin.css', __FILE__), array('#474247', '#de1e7e', '#ec76b1', '#d51d79'));
}
}
示例10: wpacs_add_color_schemes
/**
* Register the color schemes
*/
function wpacs_add_color_schemes()
{
$rtlsuff = is_rtl() ? '-rtl' : '';
wp_admin_css_color('blood', __('Blood', 'wpacs-admin-schemes'), plugins_url("blood/colors{$rtlsuff}.css", __FILE__), array('#bf0000', '#fc4141', '#222222', '#b03f3f'));
wp_admin_css_color('babyblue', __('Baby Blue', 'wpacs-admin-schemes'), plugins_url("babyblue/colors{$rtlsuff}.css", __FILE__), array('#6bc4ff', '#0077ff', '#034799', '#08a8cc'));
wp_admin_css_color('fresh', __('Fresh', 'wpacs-admin-schemes'), plugins_url("fresh/colors{$rtlsuff}.css", __FILE__), array('#71bd00', '#a7e051', '#426e00', '#7f9959'));
wp_admin_css_color('pumpkin', __('Pumpkin', 'wpacs-admin-schemes'), plugins_url("pumpkin/colors{$rtlsuff}.css", __FILE__), array('#c99300', '#edbc34', '#7a5900', '#ccb064'));
wp_admin_css_color('night', __('Night', 'wpacs-admin-schemes'), plugins_url("night/colors{$rtlsuff}.css", __FILE__), array('#222222', '#444444', '#666666', '#333333'));
wp_admin_css_color('facebook', __('Facebook', 'wpacs-admin-schemes'), plugins_url("facebook/colors{$rtlsuff}.css", __FILE__), array('#2a4994', '#3763d4', '#252661', '#132142'));
wp_admin_css_color('tiranga', __('Tiranga', 'wpacs-admin-schemes'), plugins_url("tiranga/colors{$rtlsuff}.css", __FILE__), array('#ff9933', '#128807', '#000088', '#94510d'));
wp_admin_css_color('remix', __('Remix', 'wpacs-admin-schemes'), plugins_url("remix/colors{$rtlsuff}.css", __FILE__), array('#aa9d88', '#627c83', '#59524c', '#e14d43'));
wp_admin_css_color('modern', __('Modern', 'wpacs-admin-schemes'), plugins_url("modern/colors{$rtlsuff}.css", __FILE__), array('#009688', '#ffc107', '#212121', '#00796b'));
wp_admin_css_color('elegance', __('Elegance', 'wpacs-admin-schemes'), plugins_url("elegance/colors{$rtlsuff}.css", __FILE__), array('#568259', '#4a4238', '#00120b', '#3f6142'));
wp_admin_css_color('simplicity', __('Simplicity', 'wpacs-admin-schemes'), plugins_url("simplicity/colors{$rtlsuff}.css", __FILE__), array('#9e9e9e', '#cddc39', '#616161', '#98a80c'));
wp_admin_css_color('chocolate', __('Chocolate', 'wpacs-admin-schemes'), plugins_url("chocolate/colors{$rtlsuff}.css", __FILE__), array('#5d4037', '#795548', '#362620', '#422d26'));
}
示例11: makeHooks
/**
* Build admin hooks.
*
* @since 3.3.0
*/
public function makeHooks()
{
//Admin panel
if (!TTO_IS_ADMIN) {
return;
}
//i18n
$locale = apply_filters('theme_locale', get_locale(), TTO_I18N);
load_textdomain(TTO_I18N, TTO_PATH . '/languages/' . $locale . '.mo');
//Add custom CSS colors ~ Earth
wp_admin_css_color('teatocss-earth', TeaThemeOptions::__('Tea T.O. ~ Earth'), TTO_URI . '/assets/css/teato.admin.earth.css?ver=v' . TTO_VERSION_NUM, array('#222', '#303231', '#55bb3a', '#91d04d'));
//Add custom CSS colors ~ Ocean
wp_admin_css_color('teatocss-ocean', TeaThemeOptions::__('Tea T.O. ~ Ocean'), TTO_URI . '/assets/css/teato.admin.ocean.css?ver=v' . TTO_VERSION_NUM, array('#222', '#303231', '#3a80bb', '#4d9dd0'));
//Add custom CSS colors ~ Vulcan
wp_admin_css_color('teatocss-vulcan', TeaThemeOptions::__('Tea T.O. ~ Vulcan'), TTO_URI . '/assets/css/teato.admin.vulcan.css?ver=v' . TTO_VERSION_NUM, array('#222', '#303231', '#bb3a3a', '#d04d4d'));
//Add custom CSS colors ~ Wind
wp_admin_css_color('teatocss-wind', TeaThemeOptions::__('Tea T.O. ~ Wind'), TTO_URI . '/assets/css/teato.admin.wind.css?ver=v' . TTO_VERSION_NUM, array('#222', '#303231', '#69d2e7', '#a7dbd8'));
//Hooks
add_action('admin_menu', array(&$this, 'hookAssets'), 999);
//Get configs
$hooks = TeaThemeOptions::getConfigs('backendhooks');
$modules = TeaThemeOptions::getConfigs('modules');
if (isset($hooks['emojicons']) && $hooks['emojicons']) {
add_action('init', array(&$this, 'hookDisableWPEmojicons'));
}
if (isset($hooks['versioncheck']) && $hooks['versioncheck']) {
add_action('after_setup_theme', array(&$this, 'hookRemoveAdminWPVersionCheck'));
}
if (isset($hooks['baricons']) && $hooks['baricons']) {
add_action('wp_before_admin_bar_render', array(&$this, 'hookRemoveBarIcons'));
}
if (isset($hooks['menus']) && $hooks['menus']) {
add_action('admin_menu', array(&$this, 'hookRemoveMenus'));
}
if (isset($modules['sanitizedfilename']) && $modules['sanitizedfilename']) {
add_filter('sanitize_file_name', array(&$this, 'hookSanitizeFilename'), 10);
}
}
示例12: colorScheme
/**
* Custom Admin Color Scheme
*/
public function colorScheme()
{
global $color_scheme;
global $base_plugin_directory;
wp_admin_css_color('custom-scheme', $color_scheme, $base_plugin_directory . '/assets/css/colors.css', array('#000000', '#e72234', '#ebecec', '#456a7f'));
}
示例13: register_admin_style
/**
* Registers the bbPress admin color scheme
*
* Because wp-content can exist outside of the WordPress root there is no
* way to be certain what the relative path of the admin images is.
* We are including the two most common configurations here, just in case.
*
* @since bbPress (r2521)
*
* @uses wp_admin_css_color() To register the color scheme
*/
public function register_admin_style()
{
wp_admin_css_color('bbpress', __('Green', 'bbpress'), $this->styles_url . 'admin.css', array('#222222', '#006600', '#deece1', '#6eb469'));
}
示例14: register_admin_style
/**
* Registers the bbPress admin color scheme
*
* Because wp-content can exist outside of the WordPress root there is no
* way to be certain what the relative path of the admin images is.
* We are including the two most common configurations here, just in case.
*
* @since bbPress (r2521)
*
* @uses wp_admin_css_color() To register the color scheme
*/
public function register_admin_style()
{
// Updated admin color scheme CSS
if (function_exists('wp_enqueue_media')) {
$green_scheme = $this->styles_url . 'green.css';
} else {
$green_scheme = $this->styles_url . 'green-34.css';
}
// Register the green scheme
wp_admin_css_color('bbpress', esc_html_x('Green', 'admin color scheme', 'bbpress'), $green_scheme, array('#222222', '#006600', '#deece1', '#6eb469'));
}
示例15: mp6_add_admin_colors
/**
* Add an admin color scheme.
*
* This helper function makes it easier to add color schemes to the admin by
* abstracting out the steps needed to add icon colors, customizer css, etc.
*
* @since 2.0
*
* @param string $slug The color scheme slug. Used to generate the stylesheet paths, if not overriden.
* @param array $args {
* An array of arguments.
* @type string 'label' The color scheme name, human-readable.
* Defaults to slug.
* @type array 'palette' An array of CSS color definitions which are used to give the user a feel for the theme.
* Default array().
* @type array 'icon' An array of colors used by svgpainter to generate the background, hover, and active
* icon colors for custom SVG icons.
* Default array('base' => '#eee', 'focus' => '#fff', 'current' => '#fff').
* @type array 'admin_path' Path to the admin stylesheet. Internally, MP6 uses the same file structure for
* all schemes, allowing us to define the path based on the scheme's slug.
* Default plugin_dir_path( __FILE__ ) . 'schemes/'. $args['slug'] .'/admin-colors.css'.
* @type array 'admin_url' URL to the admin stylesheet.
* Default plugins_url( "schemes/$slug/admin-colors.css", __FILE__ ).
* @type array 'customizer_path' Path to the customizer stylesheet. Internally, MP6 uses the same file structure for
* all schemes, allowing us to define the path based on the scheme's slug.
* Default 'schemes/'. $args['slug'] .'/customizer.css'.
* @type array 'customizer_url' URL to the customizer stylesheet.
* Default plugins_url( "schemes/$slug/customizer.css", __FILE__ ).
* }
* @return boolean True if the admin stylesheet was found & the new theme was added; false if there was no slug,
* or the stylesheet was not found.
*/
function mp6_add_admin_colors($slug, $args = array())
{
global $_wp_admin_css_colors;
$defaults = array('label' => $slug, 'palette' => array(), 'icon' => array('base' => '#eee', 'focus' => '#fff', 'current' => '#fff'), 'admin_path' => plugin_dir_path(__FILE__) . "schemes/{$slug}/admin-colors.css", 'admin_url' => plugins_url("schemes/{$slug}/admin-colors.css", __FILE__), 'customizer_path' => plugin_dir_path(__FILE__) . "schemes/{$slug}/customizer.css", 'customizer_url' => plugins_url("schemes/{$slug}/customizer.css", __FILE__));
$args = wp_parse_args($args, $defaults);
if (file_exists($args['admin_path'])) {
wp_admin_css_color($slug, $args['label'], $args['admin_url'], $args['palette']);
$_wp_admin_css_colors[$slug]->icon_colors = $args['icon'];
if (file_exists($args['customizer_path'])) {
$_wp_admin_css_colors[$slug]->customzier = $args['customizer_path'];
$_wp_admin_css_colors[$slug]->customzier_url = $args['customizer_url'];
}
return true;
}
return false;
}