[WordPress] 外掛分享: Add Polylang support for Customizer

首頁外掛目錄 › Add Polylang support for Customizer
WordPress 外掛 Add Polylang support for Customizer 的封面圖片
2,000+
安裝啟用
★★★★
4.5/5 分(11 則評價)
1169 天前
最後更新
問題解決
WordPress 4.7+ PHP 5.6+ v1.4.5 上架:2020-01-31

內容簡介

增加 Polylang 對 Customizer 的支援

這款外掛為 WordPress Customizer 新增 Polylang 支援。

支援

我們在Frontbee 的 Discord 伺服器上提供直接的支援。

功能

在 Customizer 中增加語言選擇器。
本地化主題和選項,包括預設和自定義的 Customizer 值。
啟用/停用「語言從內容設置」的強制設置,位於語言- > 設定- > URL 修改

先決條件

必須安裝並啟用 Polylang。
必須在管理- > 語言中設置語言。
如果您有一個靜態封面:

為每種語言創建一個封面頁面。
在每種語言下,選擇前台頁面中的頁面。

預期 Customizer 將使用設定類型=theme_mod(預設),如下所示:

$wp_customize->add_setting( ‘setting_id’, [ ‘type’ => ‘theme_mod’, ] );

授權

此外掛的授權為 GPL v2 或更高版本。

本程序是自由軟體,您可以依照自由軟體基金會所發行的 GNU 通用公眾授權條款第二版或更新版本的規定修改及重新發行本程式。

本程式是基於希望它是有用的,但不設有任何擔保責任,也不承擔適銷售性和特定用途適用的擔保責任,詳情請見GNU 通用公眾授權條款。

您應該已經收到了附加於此程序的 GNU 通用公眾授權條款的副本;如果沒有,請寫信給自由軟體基金會,地址:51 Franklin St,Fifth Floor,Boston,MA 02110-1301 USA。

授權的副本已包含在外掛目錄的根目錄中。該文件名為LICENSE。

重要提示
授權

此外掛的授權為 GPL v2 或更高版本;但是,如果您選擇使用不兼容 v2 的第三方代碼,則可能需要切換到使用 GPL v3 兼容的代碼。

鳴謝

原始解決方案由@soderlind提供,可在此處找到。支持作者!這是 WordPress 外掛版本的解決方案。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.4.5) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Add Polylang support for Customizer」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Add Polylang support for Customizer
This plugin adds Polylang support for WordPress Customizer.
Support
We provide direct support via our Frontbee Discord server
Features

Language switcher in Customizer.
Localized theme_mods and options for both default and custom made Customizer values.
Enable/disable forcing “The language is set from content” setting in Language->Settings->URL modifications

Prerequisite

Polylang must be installed and activated.
Languages must be set in Admin > Languages.
If you have a static front page:

Create a front page per each language.
Select the front page in Admin > Settings > Reading per language.

Expect customizer to use setting type = theme_mod (default) as in:
$wp_customize->add_setting( ‘setting_id’, [ ‘type’ => ‘theme_mod’, ] );
License
This plugin is licensed under the GPL v2 or later.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

A copy of the license is included in the root of the plugin’s directory. The file is named LICENSE.
Important Notes
Licensing
This plugin is licensed under the GPL v2 or later; however, if you opt to use third-party code that is not compatible with v2, then you may need to switch to using code that is GPL v3 compatible.
Credits
Original solution made by @soderlind is available here. Share some love! This is WordPress plugin version of his solution.

延伸相關外掛

文章
Filter
Mastodon