hasanart/moco-framework

0.2.6 2021-04-14 18:46 UTC

This package is auto-updated.

Last update: 2024-05-15 02:28:45 UTC


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