redux-framework icon indicating copy to clipboard operation
redux-framework copied to clipboard

Create custom field type?

Open schweigerd opened this issue 12 years ago • 8 comments

Hello :)

I just wanted to ask if someone could explain me how to create a custom field type manually? I found the post in the wiki about it, but could not manage to create one with this. My setting: Shoestrap 3 -> Redux loaded via TGM plugin. I want to define a new custom field type from within my theme.

Thanks!

schweigerd avatar Feb 22 '14 14:02 schweigerd

You create a carbon copy of say the text field, give it your own name, and include it via a hook like this: add_filter( 'redux/'.$this->parent->args['opt_name'].'/field/class/'.$this->field_name, array( &$this, 'overload_field_path' ) ); // Adds the local field

;)

dovy avatar Feb 23 '14 05:02 dovy

Dovy: Where exactly would you add the above filter? Inside the theme "functions.php" file.

wpinsite avatar Mar 13 '14 00:03 wpinsite

Anywhere before you load your Redux config file. ;)

dovy avatar Mar 13 '14 02:03 dovy

Thanks for the reply. I created a custom fields for adding custom sidebars. So far all works except for deleting the sidebars through jQuery.

I used the "Slides" template as a guide.

I read that you were adding a premium extension for those who donated. Have you had a chance to develop this yet. Would love to download and receive that extension.

Thanks

wpinsite avatar Mar 13 '14 02:03 wpinsite

We already have that built. Look here: http://reduxframework.com/extension/widget-areas/

And there's a demo on the demo site: http://demo.reduxframework.com/wp-admin/widgets.php

It's quite sleek. ;)

dovy avatar Mar 13 '14 02:03 dovy

Awesome

wpinsite avatar Mar 13 '14 02:03 wpinsite

Hello I am having trouble creating a custom field to the Redux Framework, would like your help, the most practical way to help is to duplicate an existing field already, because the only thing you need to do is duplicate the inc / fields / inc slides / fields / slides-new.

I could do that and just changed the names of files and key phrases that would:

Original files:


ReduxCore> inc> fields> slides -field_slides.php -field_slides.js -field_slides.css

Duplicate files:


ReduxCore> inc> fields> slides-new -field_slides_new.php -field_slides_new.js -field_slides_new.css

++++++++++++++++++++++++++++++++

Original code:


1 if (! Class_exists ('ReduxFramework_slides')) { 2nd class {ReduxFramework_slides 3 ° wp_enqueue_script ( 'redux-field-slideshow-js' ReduxFramework :: $ _ url. 'inc / fields / slide / field_slides.js' array ('jquery-ui-core' 'jquery', 'jquery-ui-accordion', 'wp-color-picker') time (), true );

         wp_enqueue_style (
             'redux-field-slides-css',
             ReduxFramework :: $ _ url. 'inc / fields / slide / field_slides.css'
             time (),
             true
         );

Duplicate code:


1 if (! Class_exists ('ReduxFramework_slides_new')) { 2nd class {ReduxFramework_slides_new 3 ° wp_enqueue_script ( 'redux-field-slides-new-js' ReduxFramework :: $ _ url. 'inc / fields / slides-new / field_slides_new.js' array ('jquery-ui-core' 'jquery', 'jquery-ui-accordion', 'wp-color-picker') time (), true );

         wp_enqueue_style (
             'redux-field-slides-new-css',
             ReduxFramework :: $ _ url. 'inc / fields / slides-new / field_slides_new.css'
             time (),
             true
         );

++++++++++++++++++++++++++++++++++

With this process could duplicate, but in the wordpress admin he gets a few bugs, one thing I noticed doing this procedure is that it can not load the CSS from the field that would duplicate the slides-new ReduxCore file> inc> fields> > field_slides.css, and the "Delete Slide" button does not work ..

I've tried using the procedure of link: http://docs.reduxframework.com/core/advanced/add-a-custom-field/

And I found little information to be able to do, then follow the hint to use the options: https://github.com/ReduxFramework/extension-boilerplate https://github.com/ReduxFramework/redux-extensions-loader

I could not do for not having more detailed information on the subject and little support, so I am trying to contact you. Many people may think that this problem.

Help me ...

gabrielpadilha avatar Nov 11 '14 12:11 gabrielpadilha

We won't help you debug your code without premium support. This is beyond the scope of the free Redux core. Best of luck.

dovy avatar Nov 11 '14 14:11 dovy