hasanart/moco-framework
Composer 安装命令:
composer require hasanart/moco-framework
包简介
wordpress development framework
README 文档
README
Wordpress Development Framework Theme & Plugin Options
How to use
use with composer
If you wish to use this extension in a managed environment, simply install using composer:
composer require hasanart/moco-framework
include vendor autoloader in function.php in theme or plugin
include('vendor/autoload.php');
use in your theme directory
download last release and copy into your theme
include('moco-framework/index.php');
use with install plugin
download last release and copy into wp-content/plugins and active plugin in plugin list
use framework
To use the Moco Framework
use MocoFramework\Helper\Controls; //use Globa Variable global $moco_framework; // set your Tabs & option Controls $options = [ //tabs [ 'id' => 'general', 'title' => 'General', 'icon' => 'fa-dashboard', 'controls' => [ [ 'id' => 'Text Control', 'type' => Controls::Text, 'title' => 'wordpress test', 'desc' => 'wordpress test test', 'placeholder' => 'wordpress ...', 'default' => 'wordpress ...', 'detail' => 'wordpress detail' ], [ 'id' => 'js', 'type' => Controls::CodeEditor, 'title' => 'codeEditor', ], [ 'id' => 'wp_editor', 'type' => Controls::WpEditor, 'title' => 'Wp Editor', 'default' => 'defaul content with support html', ] ] ], //external tab link () [ 'id' => 'external', 'title' => 'External', 'icon' => 'fa-external', 'link' => 'https://wpdev.ir/', ] ]; //make new option page $moco_framework->option() ->setTitle('Moco Framework Options') ->setSubTitle('the best of options package') ->setMenu('Moco Options') ->setSlug('moco-options') ->setPosition(99) ->options($options);
sub menu
To use the Moco Framework
use MocoFramework\Helper\Controls; //use Globa Variable global $moco_framework; // set your Tabs & option Controls $options = [ //tabs [ 'id' => 'general', 'title' => 'General', 'icon' => 'fa-dashboard', 'submenu' => [ [ 'id' => 'subGeneral', 'title' => 'Sub General', 'icon' => 'fa-dashboard', 'controls' => [ [ 'id' => 'Text Control', 'type' => Controls::Text, 'title' => 'wordpress test', 'desc' => 'wordpress test test', 'placeholder' => 'wordpress ...', 'default' => 'wordpress ...', 'detail' => 'wordpress detail' ], [ 'id' => 'js', 'type' => Controls::CodeEditor, 'title' => 'codeEditor', ], [ 'id' => 'wp_editor', 'type' => Controls::WpEditor, 'title' => 'Wp Editor', 'default' => 'defaul content with support html', ] ] ], ] ], //external tab link () [ 'id' => 'external', 'title' => 'External', 'icon' => 'fa-external', 'link' => 'https://wpdev.ir/', ] ]; //make new option page $moco_framework->option() ->setTitle('Moco Framework Options') ->setSubTitle('the best of options package') ->setMenu('Moco Options') ->setSlug('moco-options') ->setPosition(99) ->options($options);
get option value
global $moco_framework; $moco_framework->getOption('moco-options', 'logo','defautl logo url' );
make easy function for get yourself option
function get_moco($option, $default = false){ global $moco_framework; return $moco_framework->getOption('moco-options', $option, $default ); }
To do Features
- Option Page
- Metabox
- Customize Option
- Widget
- Menu Option
- Backup Options
- Update Theme Or Plugin
- License Theme Or Plugin
To do Fields
- Text
- Textarea
- Code Editor
- Wp Editor
- Radio
- Checkbox
- Select
- Select Media
- Switch
- Select2
- tag
- Color Picker
- Date Picker
- Draggable
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2021-03-30