ridiculous-innovations/live-ui-wordpress
Composer 安装命令:
composer require ridiculous-innovations/live-ui-wordpress
包简介
Wordpress plugin for Live UI.
README 文档
README
Instalation instruction
- Download the module
- Move files into a ./wp-content/plugins/liveui
- Activate the plugin in your WordPress admin panel
- Go to LiveUI settings in the admin panel and put in your app API key
All keys below are used without the hash symbol (so #MY_IMAGE in the admin panel will be only MY_IMAGE in WP)
Translations
To return a translated string you can use method LUI(key, locale), method returns a string with the translation or the key if translation is missing
Example:
<h1><?php echo LUI('MyWebHeader', 'en_US'); ?></h1>
To get available locales in an array ( { 'en_US', 'it', 'de' } )
liveui::get_available_locales();
Images
To get an image URL, you can call LUIImage(key, locale). This method returns a local link to the file.
If the file is not present in the local cache, it will be downloaded from the LiveUI system and cached locally so the local server is responsible for the distribution.
Example:
<img src="<?php echo LUIImage('MyLogoImage', 'it'); ?> alt="Company Logo (Italian)" />
Colors
To get a color you can use LUIColor(key) method. This will return the color HEX representation (Ex. FF0000). The value will be returned without the hash (#) character.
Example:
<span style="color: #<?php echo LUIColor('MyHeaderColor'); ?>;">My text with remotely controlled color</span>
Some colors can be set to use an alpha value, in that case you can check for LUIColorAlpha(key) which returns a value between 0-100 which represent the opacity. For example value 80 means the color should be displayed with 80% opacity.
For any technical questions please use StackOverflow with a tag "liveui". For any problems with the system, please create a github.com issue.
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2015-09-04