[wordpress插件] Admin Color Schema管理员颜色架构

wordpress 插件 文章 2020-02-02 23:20 669 0 全屏看文

AI助手支持GPT4.0

评分

0

0

描述

The plugin to enable wordpress themes to add its own admin color schemas directly from theme

使wordpress主题能够直接从主题添加自己的管理颜色模式的插件

Features

功能

    1. Adding new admin color shemas directly with theme
    2. 直接使用主题添加新的管理员颜色shemas

    3. Activating specific admin color schema for every new registered user automatically
    4. 自动为每个新注册用户激活特定的管理员颜色方案

    5. Removing admin color picker from users profile
    6. 从用户个人资料中删除管理员颜色选择器

    7. Applying selected admin color shema on the wordpress adminbar in the frontend
    8. 在前端的WordPress管理栏上应用选定的管理颜色shema

    What I need

    我需要的

    You will need scss for fast theme generating based on the wordpress scss files,

    您需要 scss 来基于wordpress scss文件快速生成主题,

    But of course you can still use normal CSS file.

    但是当然您仍然可以使用普通的CSS文件。

    Contributing

    贡献

    Everyone is welcome to help contribute and improve this plugin.

    欢迎每个人为该插件做出贡献和改进。

    There are several

    有几个

    ways you can contribute:

    您的贡献方式:

      Eaxmple

      举止

      The plugin comes with an example to see how the plugin works , it is under example/Dark folder.

      该插件附带一个示例,用于查看其工作原理,该示例位于example / Dark文件夹下。

      To use the example :

      使用示例:

        1. Copy example/Dark to your/theme/folder/color-schema/Dark
        2. 将示例/深色复制到您的/主题/文件夹/ color-schema /深色

        3. Activate the new schema from you profile
        4. 从您的个人资料激活新架构

        Plugin configutaion

        插件配置

        The plugin comes with following configuration as default :

        该插件默认具有以下配置:

          <?

        php

        的PHP

        $default = array(    

        $默认=数组(    

        // path relative to the theme dir    

        //相对于主题目录的路径    

        'path' => '/color-schema',    

        '路径'=>'/ color-schema',    

        // default color-schema to activate for every new user    

        //默认的色彩模式可为每个新用户激活    

        'default' => '',    

        '默认'=>'',    

        // if true the user will be no more able to change its dashboard color schema    

        //如果为true,则用户将不再能够更改其仪表板颜色架构    

        // and the default one will be used    

        //,将使用默认值    

        'disable_color_picker' => false,    

        'disable_color_picker'=>否,    

        // enable color-schema on fontend    

        //在fontend上启用颜色模式    

        'enbale-on-frontend' => true,

        'enbale-on-frontend'=>是的,

        );

        );

        ?>

        ?>

        You can override the default configuration using add_filter function like

        您可以使用 add_filter 函数(如
        )覆盖默认配置

        in the following example :

        在以下示例中:

          <?php

        // in the your theme's functions.php file

        //在您主题的functions.php文件中

        add_filter('Hyyan\AdminColorSchema.options', function(array $default) {    

        add_filter('Hyyan \ AdminColorSchema.options',function(array $ default){    

        // read schemas from "admin-color-schema" folder relative to current theme    

        //从“ admin-color-schema”文件夹中读取与当前主题相关的架构    

        $default['path'] = '/admin-color-schema';    

        $ default ['path'] ='/ admin-color-schema';    

        // use Bluetheme as default schema for every new user    

        //使用Bluetheme作为每个新用户的默认架构    

        $default['default'] = 'BlueTheme';    

        $ default ['default'] ='BlueTheme';    

        return $default;

        返回$ default;

        });

        });

        ?>

        ?>

        Create new schema

        创建新架构

        If you are using the default path in the plugin configuration then :

        如果您在插件配置中使用默认路径,则:

          1. Create color-schema in your theme root dir
          2. 在主题根目录中创建 color-schema

          3. Create new schema dir for example : (vivid) in the color-schema dir
          4. color-schema 目录中创建新的模式目录,例如:(vivid)

          5. Create schema.ini file and configure it
          6. 创建 schema.ini 文件并进行配置

          7. create colors.scss then complie it into colors.css

            创建 colors.scss ,然后将其编译为 colors.css

            ;

            ;

            schema.ini

            schema.ini

            ;

            ;

            ==============

            =============

            ;

            ;

            ;

            ;

            the name of your theme if not set the current dir name will be used

            您的主题名称(如果未设置)将使用当前目录名称

            ;

            ;

            for example if your theme live in “color-schema/vivid” then “vivid” will be used as name of theme

            例如,如果您的主题使用“ color-schema / vivid”,那么“ vivid”将用作主题的名称

            name= my create theme

            名称=我的创建主题

            ;your translaion domain if not set the ‘defualt’ domain will be used

            ;您的翻译域名(如果未设置)将使用“默认”域名

            ;the domain will be used to translate the theme name

            ;该域将用于翻译主题名称

            domain= default

            domain =默认

            ;

            ;

            colors preview (4 colors)

            颜色预览(4种颜色)

            colors []= #52accc

            颜色[] =#52accc

            colors []= #e5f8ff

            颜色[] =#e5f8ff

            colors []= #096484

            颜色[] =#096484

            colors []= #e1a948

            颜色[] =#e1a948

            ;

            ;

            icons colors preview (4 colors)

            图标颜色预览(4种颜色)

            icons []= #52accc

            图标[] =#52accc

            icons []= #e5f8ff

            图标[] =#e5f8ff

            icons []= #096484

            图标[] =#096484

            icons []= #e1a948

            图标[] =#e1a948

            // colors.scss

            // colors.scss

            // ============

            // ===========

            $base-color: #52accc;

            $ base-color:#52accc;

            $icon-color: #e5f8ff;

            $ icon-color:#e5f8ff;

            $highlight-color: #096484;

            $ highlight-color:#096484;

            $notification-color: #e1a948;

            $ notification-color:#e1a948;

            $button-color: #e1a948;

            $ button-color:#e1a948;

            $menu-submenu-text: #e2ecf1;

            $ menu-submenu-text:#e2ecf1;

            $menu-submenu-focus-text: #fff;

            $ menu-submenu-focus-text:#fff;

            $menu-submenu-background: #4796b3;

            $ menu-submenu-background:#4796b3;

            // require the path relative to your wordpres (wp-admin) folder

            //要求相对于您的wordpres(wp-admin)文件夹的路径

            @import “…../wp-admin/css/colors/_admin.scss”;

            @import“ ..... / wp-admin / css / colors / _admin.scss”;

          You are done …

          您完成了……

          Go to your profile now and you will see your new color schema whiche you can

          现在转到您的个人资料,您将看到可以使用的新颜色架构

          activate

          激活

安装步骤

Classical Way

经典方式

Extract the zip file and just drop the contents in the wp-content/plugins/ directory of your WordPress installation and then activate the Plugin from Plugins page.

解压缩该zip文件,然后将其内容拖放到WordPress安装的wp-content / plugins /目录中,然后激活“来自插件的插件”页面。

Composer way

作曲家方式

    1. run composer command : composer require hyyan/admin-color-schema
    2. 运行composer命令: composer需要hyyan / admin-color-schema

下载地址

https://downloads.wordpress.org/plugin/admin-color-schema.0.4.4.zip

https://downloads.wordpress.org/plugin/admin-color-schema.0.4.4.zip

-EOF-

AI助手支持GPT4.0