[wordpress插件] Customizer Theme Switcher定制器主题切换器

wordpress 插件 文章 2020-04-10 22:50 0 251 全屏看文

This plugin is a WordPress core feature-plugin proposed for WordPress 4.2.

此插件是为WordPress 4.2建议的WordPress核心功能插件。

The goal is to bring theme-browsing and theme-switching into the Customizer to streamline the themes experience.


The current status is extremely basic code-wise, but implements most of what’s available on the themes admin page.


See our posts on Make WordPress Core for more info.


If you're interested in contributing to this project, ping @celloexpressions on WordPress core Slack.

如果您有兴趣为这个项目做贡献,请在 WordPress核心Slack 上ping @celloexpressions。



Core Merge Notes


= UX =

= UX =

* Remove #customize-info for theme previews.


* Change front-end admin bar Themes link to point to themes in the Customizer (deep-linked).


* When a new theme is activated, go to the home page (front end), not the themes admin.


* If user doesn’t confirm that they want to leave unsaved changes, remove customize-loading body class (requires core patch).




    • See inline comments.
    • 查看嵌入式注释。

    • Move custom section and control to class-wp-customize-control|section.php in wp-includes.
    • 将自定义部分和控件移至 wp-includes 中的 class-wp-customize-control | section.php

    • Merge all CSS into customize-controls.css, scope to .wp-customizer.
    • 将所有CSS合并到custom-controls.css中,范围为 .wp-customizer

    • Move .themes-panel-back to the Customizer header, adjust JS accordingly.
    • .themes-panel-back 移至Customizer标题,相应地调整JS。

    • Merge JS into customizer-controls.js, after the respective object types.
    • 在相应对象类型之后,

    • 将JS合并到 customizer-controls.js 中。

    • Merge remaining PHP (all in Customize Register callback) into register_controls() in class-wp-customize-manager.php.
    • 将剩余的PHP(全部在Customize Register回调中)合并到 class-wp-customize-manager.php 中的 register_controls()中。

    • Account for https://core.trac.wordpress.org/ticket/26611
    • https://core.trac.wordpress.org/ticket/26611的帐户


    1. Take the easy route and install through the WordPress plugin adder OR
    2. 采用简单的方法并通过WordPress插件添加程序进行安装或

    3. Download the .zip file and upload the unzipped folder to the /wp-content/plugins/ directory
    4. 下载.zip文件,并将解压缩的文件夹上载到 / wp-content / plugins / 目录

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

    7. Visit the Customizer (Appearance -> Customize) to browse & switch themes.
    8. 访问定制器(外观->定制)以浏览和切换主题。