zentheme/wpikaday
Composer 安装命令:
composer require zentheme/wpikaday
包简介
A Pikaday calendar Control for Wordpress customizer.
README 文档
README
This module provides a Wordpress customizer Control based on the Pikaday Datepicker project. The module is available via composer so it can be added to a plugin or theme.
The Pikaday Datepicker has a pretty comprehensive range of config options, most of which are available to the Control, you can check them out on the Pikaday Project page on Github.
Install with composer
Download and install Composer by following the official instructions. For usage, see the documentation.
Run the following in your terminal to install the module with Composer.
$ composer require zentheme/wpikaday
As this project uses PSR-4 autoloading you will need to use Composers autoloader.
Using the Control
Below is a simple example of how the control might be used in a plugin or theme. The example assumes that the vendor/autoload.php file has already been included.
use Zentheme\Customizer\Control\PikadayControl; // Projects customizer configuration add_action( 'customize_register', function( $wpCustomize ) { // Add a section... $wpCustomize->add_section( 'pikaday_section', [ 'title' => 'Pikaday Section' ] ); // Then a setting... $wpCustomize->add_setting( 'pikaday_setting', [ 'default' => '', 'transport' => 'postMessage' ] ); // ...and finally add the Pikaday control $wpCustomize->add_control( new PikadayControl( $wpCustomize, 'pikaday_control', [ 'label' => 'Pikaday Calendar', 'section' => 'pikaday_section', 'settings' => 'pikaday_setting', 'position' => 'bottom right', // position the datepicker 'format' => 'MMMM Do YYYY' // define the date format // ... add any other valid Pikaday params here ] ) ); } );
Notes
- Licensed under the MIT License
- Maintained under the Semantic Versioning Guide
Author
John Dundon
统计信息
- 总下载量: 15
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-12-06