Unyson icon indicating copy to clipboard operation
Unyson copied to clipboard

Media Setting Options

Open ankitaraikundalia opened this issue 11 years ago • 4 comments

How can I create the below options using Unyson?

image-settings

I want to add image sizes for my CPT from these options.

ankitaraikundalia avatar Jun 30 '15 07:06 ankitaraikundalia

Do you mean this?

If yes, we don't have that, we have slider option type.


Or you want exactly the same design to be achieved using Unyson options?

If yes, using existing built-in options, you can't.

You can create your own option type.

ghost avatar Jun 30 '15 08:06 ghost

@moldcraft , I followed the instructions on http://manual.unyson.io/en/latest/options/create-option-type.html to create a new option type and I got the below output:

new-option-type

What could be the possible error?

ankitaraikundalia avatar Jun 30 '15 10:06 ankitaraikundalia

Can you show us your option-type code?

ghost avatar Jun 30 '15 11:06 ghost

@moldcraft , I had written the wrong function name while doing add_action in hooks.php. The issue is resolved now.

However, I found 2 errors in your documentation. 1: In {theme}/inc/hooks.php, we define the function _action_theme_include_custom_option_types(). In this function, the path for the class file should be:

require_once dirname(__FILE__) . '/includes/option-types/new/class-fw-option-type-new.php';

/includes is mising in the documentation.

2: In the class file class-fw-option-type-new.php , the path to scripts.js file is wrong. It should be:

wp_enqueue_script(
            'fw-option-'. $this->get_type(),
            $uri .'/js/scripts.js',
            array('fw-events', 'jquery')
        );

ankitaraikundalia avatar Jun 30 '15 13:06 ankitaraikundalia