k1sul1/polylang-get-all-translations
Composer 安装命令:
composer require k1sul1/polylang-get-all-translations
包简介
New function to Polylang that prints all translations as key-value pairs.
README 文档
README
Get all translations for the current language as a single key-value object. Calls are cached for performance.
You can use the object in wp_localize_script() to print all string translations to the client as a JavaScript object.
pl_get_all_translations() gives you a cached array of keypairs.
There's a few filters that you can use to configure the plugin.
Requirements
- Polylang
- PHP 5.4+
Installation
Install the plugin via Composer
composer require k1sul1/polylang-get-all-translations
Activate the plugin
wp plugin activate polylang-get-all-translations
Usage
wp_enqueue_script('theme-js', get_stylesheet_directory_uri() . '/dist/js/bundle.js', false, $version, true); wp_localize_script('theme-js', 'pll', pl_get_all_translations());
统计信息
- 总下载量: 71
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2016-12-30