Wordpress Development Framework Theme & Plugin Options
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');
download last release and copy into your theme
include('moco-framework/index.php');
download last release and copy into wp-content/plugins and active plugin in plugin list
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);
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);
global $moco_framework;
$moco_framework->getOption('moco-options', 'logo','defautl logo url' );
function get_moco($option, $default = false){
global $moco_framework;
return $moco_framework->getOption('moco-options', $option, $default );
}
- Option Page
- Metabox
- Customize Option
- Widget
- Menu Option
- Backup Options
- Update Theme Or Plugin
- License Theme Or Plugin
- Text
- Textarea
- Code Editor
- Wp Editor
- Radio
- Checkbox
- Select
- Select Media
- Switch
- Select2
- tag
- Color Picker
- Date Picker
- Draggable