hasanart / moco-framework
wordpress development framework
Fund package maintenance!
www.paypal.com/donate/?hosted_button_id=EMQ6QQLR74EAG
Requires
- php: >=7.0
- ext-json: *
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