initial commit

This commit is contained in:
2024-04-29 13:12:44 +05:45
commit 34887303c5
19300 changed files with 5268802 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
<?php
/**
* Redux Framework callback config.
* For full documentation, please visit: http://devs.redux.io/
*
* @package Redux Framework
*/
defined( 'ABSPATH' ) || exit;
Redux::set_section(
$opt_name,
array(
'title' => esc_html__( 'Callback', 'your-textdomain-here' ),
'id' => 'additional-callback',
'desc' => esc_html__( 'For full documentation on this field, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/configuration/fields/data.html#using-a-custom-callback" target="_blank">https://devs.redux.io/configuration/fields/data.html#using-a-custom-callback</a>',
'subsection' => true,
'fields' => array(
array(
'id' => 'opt-custom-callback',
'type' => 'callback',
'title' => esc_html__( 'Custom Field Callback', 'your-textdomain-here' ),
'subtitle' => esc_html__( 'This is a completely unique field type', 'your-textdomain-here' ),
'desc' => esc_html__( 'This is created with a callback function, so anything goes in this field. Make sure to define the function though.', 'your-textdomain-here' ),
'callback' => 'redux_my_custom_field',
),
),
)
);
if ( ! function_exists( 'redux_my_custom_field' ) ) {
/**
* Custom function for the callback referenced above.
*
* @param array $field Field array.
* @param mixed $value Set value.
*/
function redux_my_custom_field( array $field, $value ) {
print_r( $field ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions
echo '<br/>';
print_r( $value ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions
}
}

View File

@@ -0,0 +1,118 @@
<?php
/**
* Redux Framework required/linking config.
* For full documentation, please visit: http://devs.redux.io/
*
* @package Redux Framework
*/
defined( 'ABSPATH' ) || exit;
Redux::set_section(
$opt_name,
array(
'title' => esc_html__( 'Field Required / Linking', 'your-textdomain-here' ),
'id' => 'required',
'desc' => esc_html__( 'For full documentation on validation, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/configuration/fields/required.html" target="_blank">https://devs.redux.io/configuration/fields/required.html</a>',
'subsection' => true,
'fields' => array(
array(
'id' => 'opt-required-basic',
'type' => 'switch',
'title' => esc_html__( 'Basic Required Example', 'your-textdomain-here' ),
'subtitle' => wp_kses_post( __( 'Click <code>On</code> to see the text field appear.', 'your-textdomain-here' ) ),
'default' => false,
),
array(
'id' => 'opt-required-basic-text',
'type' => 'text',
'title' => esc_html__( 'Basic Text Field', 'your-textdomain-here' ),
'subtitle' => wp_kses_post( __( 'This text field is only show when the above switch is set to <code>On</code>, using the <code>required</code> argument.', 'your-textdomain-here' ) ),
'required' => array( 'opt-required-basic', '=', true ),
),
array(
'id' => 'opt-required-divide-1',
'type' => 'divide',
),
array(
'id' => 'opt-required-nested',
'type' => 'switch',
'title' => esc_html__( 'Nested Required Example', 'your-textdomain-here' ),
'subtitle' => wp_kses_post( __( 'Click <code>On</code> to see another set of options appear.', 'your-textdomain-here' ) ),
'default' => false,
),
array(
'id' => 'opt-required-nested-buttonset',
'type' => 'button_set',
'title' => esc_html__( 'Multiple Nested Required Examples', 'your-textdomain-here' ),
'subtitle' => wp_kses_post( __( 'Click any button to show different fields based on their <code>required</code> statements.', 'your-textdomain-here' ) ),
'options' => array(
'button-text' => esc_html__( 'Show Text Field', 'your-textdomain-here' ),
'button-textarea' => esc_html__( 'Show Textarea Field', 'your-textdomain-here' ),
'button-editor' => esc_html__( 'Show WP Editor', 'your-textdomain-here' ),
'button-ace' => esc_html__( 'Show ACE Editor', 'your-textdomain-here' ),
),
'required' => array( 'opt-required-nested', '=', true ),
'default' => 'button-text',
),
array(
'id' => 'opt-required-nested-text',
'type' => 'text',
'title' => esc_html__( 'Nested Text Field', 'your-textdomain-here' ),
'required' => array( 'opt-required-nested-buttonset', '=', 'button-text' ),
),
array(
'id' => 'opt-required-nested-textarea',
'type' => 'textarea',
'title' => esc_html__( 'Nested Textarea Field', 'your-textdomain-here' ),
'required' => array( 'opt-required-nested-buttonset', '=', 'button-textarea' ),
),
array(
'id' => 'opt-required-nested-editor',
'type' => 'editor',
'title' => esc_html__( 'Nested Editor Field', 'your-textdomain-here' ),
'required' => array( 'opt-required-nested-buttonset', '=', 'button-editor' ),
),
array(
'id' => 'opt-required-nested-ace',
'type' => 'ace_editor',
'title' => esc_html__( 'Nested ACE Editor Field', 'your-textdomain-here' ),
'required' => array( 'opt-required-nested-buttonset', '=', 'button-ace' ),
),
array(
'id' => 'opt-required-divide-2',
'type' => 'divide',
),
array(
'id' => 'opt-required-select',
'type' => 'select',
'title' => esc_html__( 'Select Required Example', 'your-textdomain-here' ),
'subtitle' => esc_html__( 'Select a different option to display its value. Required may be used to display multiple & reusable fields', 'your-textdomain-here' ),
'options' => array(
'no-sidebar' => esc_html__( 'No Sidebars', 'your-textdomain-here' ),
'left-sidebar' => esc_html__( 'Left Sidebar', 'your-textdomain-here' ),
'right-sidebar' => esc_html__( 'Right Sidebar', 'your-textdomain-here' ),
'both-sidebars' => esc_html__( 'Both Sidebars', 'your-textdomain-here' ),
),
'default' => 'no-sidebar',
'select2' => array( 'allowClear' => false ),
),
array(
'id' => 'opt-required-select-left-sidebar',
'type' => 'select',
'title' => esc_html__( 'Select Left Sidebar', 'your-textdomain-here' ),
'data' => 'sidebars',
'default' => '',
'required' => array( 'opt-required-select', '=', array( 'left-sidebar', 'both-sidebars' ) ),
),
array(
'id' => 'opt-required-select-right-sidebar',
'type' => 'select',
'title' => esc_html__( 'Select Right Sidebar', 'your-textdomain-here' ),
'data' => 'sidebars',
'default' => '',
'required' => array( 'opt-required-select', '=', array( 'right-sidebar', 'both-sidebars' ) ),
),
),
)
);

View File

@@ -0,0 +1,49 @@
<?php
/**
* Redux Framework field sanitizing config.
* For full documentation, please visit: http://devs.redux.io/
*
* @package Redux Framework
*/
defined( 'ABSPATH' ) || exit;
Redux::set_section(
$opt_name,
array(
'title' => esc_html__( 'Field Sanitizing', 'your-textdomain-here' ),
'id' => 'sanitizing',
// phpcs:ignore
// 'desc' => esc_html__( 'For full documentation on sanitizing, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/configuration/fields/sanitizing/" target="_blank">https://devs.redux.io/configuration/fields/sanitizing/</a>',
'subsection' => true,
'fields' => array(
array(
'id' => 'opt-text-uppercase',
'type' => 'text',
'title' => esc_html__( 'Text Option - Force Uppercase', 'your-textdomain-here' ),
'subtitle' => esc_html__( 'Uses the strtoupper function to force all uppercase characters.', 'your-textdomain-here' ),
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
'sanitize' => array( 'strtoupper' ),
'default' => 'Force Uppercase',
),
array(
'id' => 'opt-text-sanitize-title',
'type' => 'text',
'title' => esc_html__( 'Text Option - Sanitize Title', 'your-textdomain-here' ),
'subtitle' => esc_html__( 'Uses the WordPress sanitize_title function to format text.', 'your-textdomain-here' ),
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
'sanitize' => array( 'sanitize_title' ),
'default' => 'Sanitize This Title',
),
array(
'id' => 'opt-text-custom-sanitize',
'type' => 'text',
'title' => esc_html__( 'Text Option - Custom Sanitize', 'your-textdomain-here' ),
'subtitle' => esc_html__( 'Uses the custom function redux_custom_sanitize to capitalize every other letter.', 'your-textdomain-here' ),
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
'sanitize' => array( 'redux_custom_sanitize' ),
'default' => 'Sanitize This Text',
),
),
)
);

View File

@@ -0,0 +1,164 @@
<?php
/**
* Redux Framework field validation config.
* For full documentation, please visit: http://devs.redux.io/
*
* @package Redux Framework
*/
defined( 'ABSPATH' ) || exit;
Redux::set_section(
$opt_name,
array(
'title' => esc_html__( 'Field Validation', 'your-textdomain-here' ),
'id' => 'validation',
'desc' => esc_html__( 'For full documentation on validation, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/configuration/fields/validate.html" target="_blank">https://devs.redux.io/configuration/fields/validate.html</a>',
'subsection' => true,
'fields' => array(
array(
'id' => 'opt-text-email',
'type' => 'text',
'title' => esc_html__( 'Text Option - Email Validated', 'your-textdomain-here' ),
'subtitle' => esc_html__( 'This is a little space under the Field Title in the Options table, additional info is good in here.', 'your-textdomain-here' ),
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
'validate' => 'email',
'msg' => 'An error message you could customize via your option array!',
'default' => 'test@test.com',
),
array(
'id' => 'opt-text-post-type',
'type' => 'text',
'title' => esc_html__( 'Text Option with Data Attributes', 'your-textdomain-here' ),
'subtitle' => esc_html__( 'You can also pass an options array if you want. Set the default to whatever you like.', 'your-textdomain-here' ),
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
'data' => 'post_type',
),
array(
'id' => 'opt-multi-text',
'type' => 'multi_text',
'title' => esc_html__( 'Multi Text Option - Color Validated', 'your-textdomain-here' ),
'validate' => 'color',
'subtitle' => esc_html__( 'If you enter an invalid color it will be removed. Try using the text "blue" as a color. ;)', 'your-textdomain-here' ),
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
),
array(
'id' => 'opt-text-url',
'type' => 'text',
'title' => esc_html__( 'Text Option - URL Validated', 'your-textdomain-here' ),
'subtitle' => esc_html__( 'This must be a URL.', 'your-textdomain-here' ),
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
'validate' => 'url',
'default' => 'https://redux.io',
),
array(
'id' => 'opt-text-numeric',
'type' => 'text',
'title' => esc_html__( 'Text Option - Numeric Validated', 'your-textdomain-here' ),
'subtitle' => esc_html__( 'This must be numeric.', 'your-textdomain-here' ),
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
'validate' => array( 'numeric', 'not_empty' ),
'default' => '0',
),
array(
'id' => 'opt-text-comma-numeric',
'type' => 'text',
'title' => esc_html__( 'Text Option - Comma Numeric Validated', 'your-textdomain-here' ),
'subtitle' => esc_html__( 'This must be a comma separated string of numerical values.', 'your-textdomain-here' ),
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
'validate' => 'comma_numeric',
'default' => '0',
),
array(
'id' => 'opt-text-no-special-chars',
'type' => 'text',
'title' => __( 'Text Option - No Special Chars Validated', 'your-textdomain-here' ),
'subtitle' => __( 'This must be a alpha numeric only.', 'your-textdomain-here' ),
'desc' => __( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
'validate' => 'no_special_chars',
'default' => '0',
),
array(
'id' => 'opt-text-str_replace',
'type' => 'text',
'title' => esc_html__( 'Text Option - Str Replace Validated', 'your-textdomain-here' ),
'subtitle' => esc_html__( 'You decide.', 'your-textdomain-here' ),
'desc' => esc_html__( 'This field\'s default value was changed by a filter hook!', 'your-textdomain-here' ),
'validate' => 'str_replace',
'str' => array(
'search' => ' ',
'replacement' => '-thisisaspace-',
),
'default' => 'This is the default.',
),
array(
'id' => 'opt-text-preg_replace',
'type' => 'text',
'title' => esc_html__( 'Text Option - Preg Replace Validated', 'your-textdomain-here' ),
'subtitle' => esc_html__( 'You decide.', 'your-textdomain-here' ),
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
'validate' => 'preg_replace',
'preg' => array(
'pattern' => '/.*?\\d.*?\\d(\\d)/is',
'replacement' => 'no numbers',
),
'default' => '0',
),
array(
'id' => 'opt-text-custom_validate',
'type' => 'text',
'title' => esc_html__( 'Text Option - Custom Callback Validated', 'your-textdomain-here' ),
'subtitle' => esc_html__( 'You decide.', 'your-textdomain-here' ),
'desc' => wp_kses( __( 'Enter <code>1</code> and click <strong>Save Changes</strong> for an error message, or enter <code>2</code> and click <strong>Save Changes</strong> for a warning message.', 'your-textdomain-here' ), $kses_exceptions ),
'validate_callback' => 'redux_validate_callback_function',
'default' => '0',
),
array(
'id' => 'opt-textarea-no-html',
'type' => 'textarea',
'title' => esc_html__( 'Textarea Option - No HTML Validated', 'your-textdomain-here' ),
'subtitle' => esc_html__( 'All HTML will be stripped', 'your-textdomain-here' ),
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
'validate' => 'no_html',
'default' => 'No HTML is allowed in here.',
),
array(
'id' => 'opt-textarea-html',
'type' => 'textarea',
'title' => esc_html__( 'Textarea Option - HTML Validated', 'your-textdomain-here' ),
'subtitle' => esc_html__( 'HTML Allowed (wp_kses)', 'your-textdomain-here' ),
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
'validate' => 'html', // See http://codex.wordpress.org/Function_Reference/wp_kses_post.
'default' => 'HTML is allowed in here.',
),
array(
'id' => 'opt-textarea-some-html',
'type' => 'textarea',
'title' => esc_html__( 'Textarea Option - HTML Validated Custom', 'your-textdomain-here' ),
'subtitle' => esc_html__( 'Custom HTML Allowed (wp_kses)', 'your-textdomain-here' ),
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
'validate' => 'html_custom',
'default' => '<p>Some HTML is allowed in here.</p>',
// See http://codex.wordpress.org/Function_Reference/wp_kses.
'allowed_html' => array(
'a' => array(
'href' => array(),
'title' => array(),
),
'br' => array(),
'em' => array(),
'strong' => array(),
),
),
array(
'id' => 'opt-textarea-js',
'type' => 'textarea',
'title' => esc_html__( 'Textarea Option - JS Validated', 'your-textdomain-here' ),
'subtitle' => esc_html__( 'JS will be escaped', 'your-textdomain-here' ),
'desc' => esc_html__( 'This is the description field, again good for additional info.', 'your-textdomain-here' ),
'validate' => 'js',
),
),
)
);

View File

@@ -0,0 +1,8 @@
<?php
/**
* Silence is golden.
*
* @package Redux Framework
*/
echo null;

View File

@@ -0,0 +1,37 @@
<?php
/**
* Redux Framework WPML integration config.
* For full documentation, please visit: http://devs.redux.io/
*
* @package Redux Framework
*/
defined( 'ABSPATH' ) || exit;
Redux::set_section(
$opt_name,
array(
'title' => esc_html__( 'WPML Integration', 'your-textdomain-here' ),
'desc' => esc_html__( 'These fields can be fully translated by WPML (WordPress Multi-Language). This serves as an example for you to implement. For extra details look at our WPML Implementation documentation: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/guides/advanced/wpml-integration.html" target="_blank" >https://devs.redux.io/guides/advanced/wpml-integration.html</a>',
'subsection' => true,
'fields' => array(
array(
'id' => 'wpml-text',
'type' => 'textarea',
'title' => esc_html__( 'WPML Text', 'your-textdomain-here' ),
'desc' => esc_html__( 'This string can be translated via WPML.', 'your-textdomain-here' ),
),
array(
'id' => 'wpml-multicheck',
'type' => 'checkbox',
'title' => esc_html__( 'WPML Multi Checkbox', 'your-textdomain-here' ),
'desc' => esc_html__( 'You can literally translate the values via key.', 'your-textdomain-here' ),
'options' => array(
'1' => esc_html__( 'Option 1', 'your-textdomain-here' ),
'2' => esc_html__( 'Option 2', 'your-textdomain-here' ),
'3' => esc_html__( 'Option 3', 'your-textdomain-here' ),
),
),
),
)
);