3

I want to create new field in redux wordpress framework using Custom fields, but I can't find any help or example using this.

i want to create a field with a switch and text field both.

Any suggestions is most appreciated.

Clarkie
  • 6,818
  • 8
  • 33
  • 52
Lucifer
  • 520
  • 1
  • 6
  • 25
  • Have you written an extension? Are you willed to re-share it to the community? I'd be interested in this extension! Thank you :) – ThomasB Feb 08 '16 at 10:06

2 Answers2

7

Lead dev of Redux here.

If you want to make a new field, then you should build an extension. We've setup two repos that will help you get started.

First: https://github.com/ReduxFramework/extension-boilerplate This is an extension boilerplate. It will help you see how to do this.

Second, is the extension loader: https://github.com/ReduxFramework/redux-extensions-loader

This will load the extension. You can also use it to overload any existing Redux fields.

Be VERY careful to load your Redux options in this order:

  1. Extension Loader
  2. Redux Options Config File

Otherwise Redux will be initialized before you run the extension hooks to overload/add new types. From there you just call your custom field type like you would any other field.

Good luck!

Dovy
  • 1,210
  • 9
  • 18
0

In order to update the answer, it's important to note that this page refers to the legacy method to load extensions.

The current method to load extensions is by adding the next line into redux config file (I guess is OK to add it at the end of the file).

Redux::setExtensions( 'OPT_NAME', 'FULL PATH' );

...from the docs:

Be sure to replace OPT_NAME with your opt_name and FULL PATH with the full path to your extension(s) location.

Nriq
  • 11
  • 2