Hotel Raxa - Advanced Booking System Implementation

🏨 Hotel Booking Enhancements:
- Implemented Eagle Booking Advanced Pricing add-on
- Added Booking.com-style rate management system
- Created professional calendar interface for pricing
- Integrated deals and discounts functionality

💰 Advanced Pricing Features:
- Dynamic pricing models (per room, per person, per adult)
- Base rates, adult rates, and child rates management
- Length of stay discounts and early bird deals
- Mobile rates and secret deals implementation
- Seasonal promotions and flash sales

📅 Availability Management:
- Real-time availability tracking
- Stop sell and restriction controls
- Closed to arrival/departure functionality
- Minimum/maximum stay requirements
- Automatic sold-out management

💳 Payment Integration:
- Maintained Redsys payment gateway integration
- Seamless integration with existing Eagle Booking
- No modifications to core Eagle Booking plugin

🛠️ Technical Implementation:
- Custom database tables for advanced pricing
- WordPress hooks and filters integration
- AJAX-powered admin interface
- Data migration from existing Eagle Booking
- Professional calendar view for revenue management

📊 Admin Interface:
- Booking.com-style management dashboard
- Visual rate and availability calendar
- Bulk operations for date ranges
- Statistics and analytics dashboard
- Modal dialogs for quick editing

🔧 Code Quality:
- WordPress coding standards compliance
- Secure database operations with prepared statements
- Proper input validation and sanitization
- Error handling and logging
- Responsive admin interface

🤖 Generated with Claude Code (https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Hotel Raxa Dev
2025-07-11 07:43:22 +02:00
commit 5b1e2453c7
9816 changed files with 2784509 additions and 0 deletions

View File

@@ -0,0 +1,817 @@
<?php
/**
* Redux Customizer Extension Class
* Short description.
*
* @package ReduxFramework/Extentions
* @class Redux_Extension_Customizer
* @version 4.4.11
* @noinspection PhpIgnoredClassAliasDeclaration
*/
defined( 'ABSPATH' ) || exit;
// Don't duplicate me!
if ( ! class_exists( 'Redux_Extension_Customizer', false ) ) {
/**
* Main ReduxFramework customizer extension class
*
* @since 1.0.0
*/
class Redux_Extension_Customizer extends Redux_Extension_Abstract {
/**
* Set extension version.
*
* @var string
*/
public static $version = '4.4.11';
/**
* Set the name of the field. Ideally, this will also be your extension's name.
* Please use underscores and NOT dashes.
*
* @var string
*/
public $field_name = 'customizer';
/**
* Set the friendly name of the extension. This is for display purposes. No underscores or dashes are required.
*
* @var string
*/
public $extension_name = 'Customizer';
/**
* Original options.
*
* @var array
*/
private $orig_options = array();
/**
* Post values.
*
* @var array
*/
private static $post_values = array();
/**
* Options array.
*
* @var array
*/
public $options = array();
/**
* Controls array.
*
* @var array
*/
public $controls = array();
/**
* Before save array.
*
* @var array
*/
public $before_save = array();
/**
* Redux object.
*
* @var object
*/
protected $redux;
/**
* Field array.
*
* @var array
*/
private $redux_fields = array();
/**
* Redux_Extension_my_extension constructor.
*
* @param ReduxFramework $redux ReduxFramework pointer.
*/
public function __construct( $redux ) {
global $pagenow;
global $wp_customize;
parent::__construct( $redux, __FILE__ );
if ( is_admin() && ! isset( $wp_customize ) && 'customize.php' !== $pagenow && 'admin-ajax.php' !== $pagenow ) {
return;
}
$this->add_field( 'customizer' );
$this->load();
}
/**
* The customizer load code
*/
private function load() {
global $pagenow, $wp_customize;
if ( false === $this->parent->args['customizer'] ) {
return;
}
// Override the Redux_Core class.
add_filter( "redux/extension/{$this->parent->args['opt_name']}/customizer", array( $this, 'remove_core_customizer_class' ) );
if ( ! isset( $wp_customize ) && 'customize.php' !== $pagenow && 'admin-ajax.php' !== $pagenow ) {
return;
}
self::get_post_values();
if ( isset( $_POST['wp_customize'] ) && 'on' === $_POST['wp_customize'] ) { // phpcs:ignore WordPress.Security.NonceVerification
$this->parent->args['customizer_only'] = true;
}
if ( isset( $_POST['wp_customize'] ) && 'on' === $_POST['wp_customize'] && ! empty( $_POST['customized'] ) && ! isset( $_POST['action'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification
add_action( "redux/options/{$this->parent->args['opt_name']}/options", array( $this, 'override_values' ), 100 );
}
add_action( 'customize_register', array( $this, 'register_customizer_controls' ) ); // Create controls.
add_action( 'wp_head', array( $this, 'customize_preview_init' ) );
add_action( 'customize_save_after', array( &$this, 'customizer_save_after' ) ); // After save.
// Add global controls CSS file.
add_action( 'customize_controls_print_scripts', array( $this, 'enqueue_controls_css' ) );
add_action( 'customize_controls_init', array( $this, 'enqueue_panel_css' ) );
add_action( 'wp_enqueue_styles', array( $this, 'custom_css' ), 11 );
add_action( 'redux/extension/customizer/control_init', array( $this, 'create_field_classes' ), 1, 2 );
add_action( 'wp_ajax_' . $this->parent->args['opt_name'] . '_customizer_save', array( $this, 'customizer' ) );
add_action( 'customize_controls_print_styles', array( $this, 'add_nonce_html' ) );
}
/**
* Add nonce HTML for AJAX.
*/
public function add_nonce_html() {
$nonce = wp_create_nonce( 'redux_customer_nonce' );
?>
<div class="redux-customizer-nonce" data-nonce="<?php echo esc_attr( $nonce ); ?>"></div>
<?php
}
/**
* AJAX callback for customizer save...to make sanitize/validate work.
*/
public function customizer() {
try {
$return_array = array();
if ( isset( $_POST['nonce'] ) && wp_verify_nonce( sanitize_key( wp_unslash( $_POST['nonce'] ) ), 'redux_customer_nonce' ) && isset( $_POST['opt_name'] ) && '' !== $_POST['opt_name'] ) {
$redux = Redux::instance( sanitize_text_field( wp_unslash( $_POST['opt_name'] ) ) );
$post_data = wp_unslash( $_POST['data'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput
// New method to avoid input_var nonsense. Thanks @harunbasic.
$values = Redux_Functions_Ex::parse_str( $post_data );
$all_options = get_option( sanitize_text_field( wp_unslash( $_POST['opt_name'] ) ) );
$values = wp_parse_args( $values, $all_options );
$redux->options_class->set( $redux->options_class->validate_options( $values ) );
$redux->enqueue_class->get_warnings_and_errors_array();
$return_array = array(
'status' => 'success',
'options' => $redux->options,
'errors' => $redux->enqueue_class->localize_data['errors'] ?? null,
'warnings' => $redux->enqueue_class->localize_data['warnings'] ?? null,
'sanitize' => $redux->enqueue_class->localize_data['sanitize'] ?? null,
);
}
} catch ( Exception $e ) {
$return_array = array( 'status' => $e->getMessage() );
}
echo wp_json_encode( $return_array );
die;
}
/**
* Field classes.
*
* @param array $option Option.
*/
public function create_field_classes( array $option ) {
if ( empty( $this->redux_fields ) ) {
$file_paths = glob( Redux_Core::$dir . 'inc/fields/*' );
foreach ( $file_paths as $file ) {
if ( 'section' !== $file && 'divide' !== $file && 'editor' !== $file ) {
$this->redux_fields[] = str_replace( Redux_Core::$dir . 'inc/fields/', '', $file );
}
}
$file_paths = glob( Redux_Core::$dir . 'inc/extensions/*' );
foreach ( $file_paths as $file ) {
if ( 'section' !== $file && 'divide' !== $file && 'editor' !== $file ) {
$this->redux_fields[] = str_replace( Redux_Core::$dir . 'inc/extensions/', '', $file );
}
}
}
$class_name = 'Redux_Customizer_Control_' . $option['type'];
if ( ! class_exists( $class_name ) && ( in_array( $option['type'], $this->redux_fields, true ) || ( isset( $option['customizer_enabled'] ) && $option['customizer_enabled'] ) ) ) {
$upload_dir = Redux_Core::$upload_dir;
if ( ! file_exists( $upload_dir . $option['type'] . '.php' ) ) {
if ( ! is_dir( $upload_dir ) ) {
$this->parent->filesystem->execute( 'mkdir', $upload_dir );
}
$template = str_replace( '{{type}}', $option['type'], '<?php' . PHP_EOL . ' class Redux_Customizer_Control_{{type}} extends Redux_Customizer_Control {' . PHP_EOL . ' public $type = "redux-{{type}}";' . PHP_EOL . ' }' );
$this->parent->filesystem->execute( 'put_contents', $upload_dir . $option['type'] . '.php', array( 'content' => $template ) );
}
if ( file_exists( $upload_dir . $option['type'] . '.php' ) ) {
include_once $upload_dir . $option['type'] . '.php';
}
}
}
/**
* Enqueue extension scripts/styles.
*/
public function enqueue_controls_css() {
$this->parent->enqueue_class->get_warnings_and_errors_array();
$this->parent->enqueue_class->init();
if ( $this->parent->args['dev_mode'] ) {
wp_enqueue_style(
'redux-extension-customizer',
$this->extension_url . 'redux-extension-customizer.css',
array(),
self::$version
);
}
wp_enqueue_script(
'redux-extension-customizer',
$this->extension_url . 'redux-extension-customizer' . Redux_Functions::is_min() . '.js',
array( 'jquery', 'redux-js' ),
self::$version,
true
);
wp_localize_script(
'redux-extension-customizer',
'redux_customizer',
array(
'body_class' => sanitize_html_class( 'admin-color-' . get_user_option( 'admin_color' ), 'fresh' ),
)
);
}
/**
* Enqueue panel CSS>
*/
public function enqueue_panel_css() {}
/**
* Remove core customizer class.
*
* @return string
*/
public function remove_core_customizer_class(): string {
return '';
}
/**
* Customize preview init.
*/
public function customize_preview_init() {
// phpcs:ignore WordPress.NamingConventions.ValidHookName
do_action( 'redux/customizer/live_preview' );
}
/**
* Get post values.
*/
protected static function get_post_values() {
if ( empty( self::$post_values ) && ! empty( $_POST['customized'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification
self::$post_values = json_decode( stripslashes_deep( sanitize_text_field( wp_unslash( $_POST['customized'] ) ) ), true ); // phpcs:ignore WordPress.Security.NonceVerification
}
}
/**
* Override customizer values.
*
* @param array $data Values.
*
* @return array
*/
public function override_values( array $data ): array {
self::get_post_values();
if ( isset( $_POST['customized'] ) && ! empty( self::$post_values ) ) { // phpcs:ignore WordPress.Security.NonceVerification
if ( is_array( self::$post_values ) ) {
foreach ( self::$post_values as $key => $value ) {
if ( strpos( $key, $this->parent->args['opt_name'] ) !== false ) {
$key = str_replace( $this->parent->args['opt_name'] . '[', '', rtrim( $key, ']' ) );
$data[ $key ] = $value;
$GLOBALS[ $this->parent->args['global_variable'] ][ $key ] = $value;
$this->parent->options[ $key ] = $value;
}
}
}
}
return $data;
}
/**
* Render Redux fields.
*
* @param object $control .
*/
public function render( $control ) {
$field_id = str_replace( $this->parent->args['opt_name'] . '-', '', $control->redux_id );
$field = $this->options[ $field_id ];
if ( ! empty( $field['compiler'] ) ) {
echo '<tr class="compiler">';
} else {
echo '<tr>';
}
echo '<th scope="row">' . wp_kses_post( $this->parent->field_head[ $field['id'] ] ) . '</th>';
echo '<td>';
$field['name'] = $field['id'];
$this->parent->render_class->field_input( $field );
echo '</td>';
echo '</tr>';
}
// All sections, settings, and controls will be added here.
/**
* Register customizer controls.
*
* @param WP_Customize_Manager $wp_customize .
*
* @throws ReflectionException Exception.
*/
public function register_customizer_controls( WP_Customize_Manager $wp_customize ) {
if ( ! class_exists( 'Redux_Customizer_Section' ) ) {
require_once __DIR__ . '/inc/class-redux-customizer-section.php';
if ( method_exists( $wp_customize, 'register_section_type' ) ) {
$wp_customize->register_section_type( 'Redux_Customizer_Section' );
}
}
if ( ! class_exists( 'Redux_Customizer_Panel' ) ) {
require_once __DIR__ . '/inc/class-redux-customizer-panel.php';
if ( method_exists( $wp_customize, 'register_panel_type' ) ) {
$wp_customize->register_panel_type( 'Redux_Customizer_Panel' );
}
}
if ( ! class_exists( 'Redux_Customizer_Control' ) ) {
require_once __DIR__ . '/inc/class-redux-customizer-control.php';
}
// phpcs:ignore WordPress.NamingConventions.ValidHookName
do_action( 'redux/extension/customizer/control/includes' );
$order = array(
'heading' => - 500,
'option' => - 500,
);
$panel = '';
$this->parent->args['options_api'] = false;
$this->parent->options_class->register();
$parent_section_id = null;
$new_parent = true;
foreach ( $this->parent->sections as $key => $section ) {
// Not a type that should go on the customizer.
if ( isset( $section['type'] ) && ( 'divide' === $section['type'] ) ) {
continue;
}
if ( isset( $section['id'] ) && 'import/export' === $section['id'] ) {
continue;
}
// If section customizer is set to false.
if ( isset( $section['customizer'] ) && false === $section['customizer'] ) {
continue;
}
// if we are in a subsection and parent is set to customizer false !!!
if ( ( isset( $section['subsection'] ) && $section['subsection'] ) ) {
if ( $new_parent ) {
$new_parent = false;
$parent_section_id = ( $key - 1 );
}
} else { // not a subsection reset.
$parent_section_id = null;
$new_parent = true;
}
if ( isset( $parent_section_id ) && ( isset( $this->parent->sections[ $parent_section_id ]['customizer'] ) && false === $this->parent->sections[ $parent_section_id ]['customizer'] ) ) {
continue;
}
$section['permissions'] = $section['permissions'] ?? 'edit_theme_options';
// No errors please.
if ( ! isset( $section['desc'] ) ) {
$section['desc'] = '';
}
// Fill the description if there is a subtitle.
if ( empty( $section['desc'] ) && ! empty( $section['subtitle'] ) ) {
$section['desc'] = $section['subtitle'];
}
// No title is present, let's show what section is missing a title.
if ( ! isset( $section['title'] ) ) {
$section['title'] = '';
}
// Let's make a section ID from the title.
if ( empty( $section['id'] ) ) {
$section['id'] = Redux_Core::strtolower( str_replace( ' ', '', $section['title'] ) );
}
// Let's set a default priority.
if ( empty( $section['priority'] ) ) {
$section['priority'] = $order['heading'];
++$order['heading'];
}
$section['id'] = $this->parent->args['opt_name'] . '-' . $section['id'];
if ( method_exists( $wp_customize, 'add_panel' ) && ( ! isset( $section['subsection'] ) || ( true !== $section['subsection'] ) ) && isset( $this->parent->sections[ ( $key + 1 ) ]['subsection'] ) && $this->parent->sections[ ( $key + 1 ) ]['subsection'] ) {
$this->add_panel(
$this->parent->args['opt_name'] . '-' . $section['id'],
array(
'priority' => $section['priority'],
'capability' => $section['permissions'],
'title' => $section['title'],
'section' => $section,
'opt_name' => $this->parent->args['opt_name'],
'description' => '',
),
$wp_customize
);
$panel = $this->parent->args['opt_name'] . '-' . $section['id'];
$this->add_section(
$section['id'],
array(
'title' => $section['title'],
'priority' => $section['priority'],
'description' => $section['desc'],
'section' => $section,
'opt_name' => $this->parent->args['opt_name'],
'capability' => $section['permissions'],
'panel' => $panel,
),
$wp_customize
);
} else {
if ( ! isset( $section['subsection'] ) || ( true !== $section['subsection'] ) ) {
$panel = '';
}
$this->add_section(
$section['id'],
array(
'title' => $section['title'],
'priority' => $section['priority'],
'description' => $section['desc'],
'opt_name' => $this->parent->args['opt_name'],
'section' => $section,
'capability' => $section['permissions'],
'panel' => $panel,
),
$wp_customize
);
}
if ( ( empty( $section['fields'] ) ) ) {
continue;
}
foreach ( $section['fields'] as $skey => $option ) {
if ( isset( $option['customizer'] ) && false === $option['customizer'] ) {
continue;
}
if ( false === $this->parent->args['customizer'] && ( ! isset( $option['customizer'] ) || true !== $option['customizer'] ) ) {
continue;
}
$this->options[ $option['id'] ] = $option;
add_action( 'redux/customizer/control/render/' . $this->parent->args['opt_name'] . '-' . $option['id'], array( $this, 'render' ) );
$option['permissions'] = $option['permissions'] ?? 'edit_theme_options';
// Change the item priority if not set.
if ( 'heading' !== $option['type'] && ! isset( $option['priority'] ) ) {
$option['priority'] = $order['option'];
++$order['option'];
}
if ( ! empty( $this->options_defaults[ $option['id'] ] ) ) {
$option['default'] = $this->options_defaults['option']['id'];
}
if ( ! isset( $option['default'] ) ) {
$option['default'] = '';
}
if ( ! isset( $option['title'] ) ) {
$option['title'] = '';
}
$option['id'] = $this->parent->args['opt_name'] . '[' . $option['id'] . ']';
if ( 'heading' !== $option['type'] && 'import_export' !== $option['type'] && ! empty( $option['type'] ) ) {
$wp_customize->add_setting(
$option['id'],
array(
'default' => $option['default'],
'transport' => 'refresh',
'opt_name' => $this->parent->args['opt_name'],
'sanitize_callback' => array( $this, 'field_validation' ),
)
);
}
if ( ! empty( $option['data'] ) && empty( $option['options'] ) ) {
if ( empty( $option['args'] ) ) {
$option['args'] = array();
}
if ( 'elusive-icons' === $option['data'] || 'elusive-icon' === $option['data'] || 'elusive' === $option['data'] ) {
$icons_file = Redux_Core::$dir . 'inc/fields/select/elusive-icons.php';
// phpcs:ignore WordPress.NamingConventions.ValidHookName
$icons_file = apply_filters( 'redux-font-icons-file', $icons_file );
if ( file_exists( $icons_file ) ) {
require_once $icons_file;
}
}
$option['options'] = $this->parent->wordpress_data->get( $option['data'], $option['args'] );
}
$class_name = 'Redux_Customizer_Control_' . $option['type'];
// phpcs:ignore WordPress.NamingConventions.ValidHookName
do_action( 'redux/extension/customizer/control_init', $option );
if ( ! class_exists( $class_name ) ) {
continue;
}
$wp_customize->add_control(
new $class_name(
$wp_customize,
$option['id'],
array(
'label' => $option['title'],
'section' => $section['id'],
'settings' => $option['id'],
'type' => 'redux-' . $option['type'],
'field' => $option,
'ReduxFramework' => $this->parent,
'active_callback' => ( isset( $option['required'] ) && class_exists( 'Redux_Customizer_Active_Callback' ) ) ? array(
'Redux_Customizer_Active_Callback',
'evaluate',
) : '__return_true',
'priority' => $option['priority'],
)
)
);
$section['fields'][ $skey ]['name'] = $option['id'];
if ( ! isset( $section['fields'][ $skey ]['class'] ) ) { // No errors please.
$section['fields'][ $skey ]['class'] = '';
}
$this->controls[ $section['fields'][ $skey ]['id'] ] = $section['fields'][ $skey ];
}
}
}
/**
* Add customizer section.
*
* @param string $id ID.
* @param array $args Args.
* @param WP_Customize_Manager $wp_customize .
*/
public function add_section( string $id, array $args, WP_Customize_Manager $wp_customize ) {
if ( is_a( $id, 'WP_Customize_Section' ) ) {
$section = $id;
} else {
$section = new Redux_Customizer_Section( $wp_customize, $id, $args );
}
$wp_customize->add_section( $section, $args );
}
/**
* Add a customize panel.
*
* @param WP_Customize_Panel|string $id Customize Panel object, or Panel ID.
* @param array $args Optional. Panel arguments. Default empty array.
* @param WP_Customize_Manager $wp_customize .
*
* @since 4.0.0
* @access public
*/
public function add_panel( $id, array $args, WP_Customize_Manager $wp_customize ) {
if ( is_a( $id, 'WP_Customize_Panel' ) ) {
$panel = $id;
} else {
$panel = new Redux_Customizer_Panel( $wp_customize, $id, $args );
}
$wp_customize->add_panel( $panel, $args );
}
/**
* Actions to take after customizer save.
*
* @throws ReflectionException Exception.
*/
public function customizer_save_after() {
if ( empty( $this->parent->options ) ) {
$this->parent->get_options();
}
if ( empty( $this->orig_options ) && ! empty( $this->parent->options ) ) {
$this->orig_options = $this->parent->options;
}
if ( isset( $_POST['customized'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification
$options = json_decode( sanitize_text_field( wp_unslash( $_POST['customized'] ) ), true ); // phpcs:ignore WordPress.Security.NonceVerification
$compiler = false;
$changed = false;
foreach ( $options as $key => $value ) {
if ( strpos( $key, $this->parent->args['opt_name'] ) !== false ) {
$key = str_replace( $this->parent->args['opt_name'] . '[', '', rtrim( $key, ']' ) );
if ( ! isset( $this->orig_options[ $key ] ) || $value !== $this->orig_options[ $key ] || ( isset( $this->orig_options[ $key ] ) && ! empty( $this->orig_options[ $key ] ) && empty( $value ) ) ) {
$this->parent->options[ $key ] = $value;
$changed = true;
if ( isset( $this->parent->compiler_fields[ $key ] ) ) {
$compiler = true;
}
}
}
}
if ( $changed ) {
$this->parent->options_class->set( $this->parent->options );
if ( $compiler ) {
// Have to set this to stop the output of the CSS and typography stuff.
$this->parent->no_output = true;
$this->parent->output_class->enqueue();
// phpcs:ignore WordPress.NamingConventions.ValidHookName
do_action( "redux/options/{$this->parent->args['opt_name']}/compiler", $this->parent->options, $this->parent->compilerCSS );
// phpcs:ignore WordPress.NamingConventions.ValidHookName
do_action( "redux/options/{$this->parent->args['opt_name']}/compiler/advanced", $this->parent );
}
}
}
}
/**
* Enqueue CSS/JS for the customizer controls
*
* @since 1.0.0
* @access public
* @global $wp_styles
* @return void
*/
public function enqueue() {
$localize = array(
'save_pending' => esc_html__( 'You have changes that are not saved. Would you like to save them now?', 'redux-framework' ),
'reset_confirm' => esc_html__( 'Are you sure? Resetting will lose all custom values.', 'redux-framework' ),
'preset_confirm' => esc_html__( 'Your current options will be replaced with the values of this preset. Would you like to proceed?', 'redux-framework' ),
'opt_name' => $this->parent->args['opt_name'],
'field' => $this->parent->options,
'defaults' => $this->parent->options_defaults,
'folds' => $this->parent->folds,
);
// Values used by the javascript.
wp_localize_script( 'redux-js', 'redux_opts', $localize );
// phpcs:ignore WordPress.NamingConventions.ValidHookName
do_action( 'redux-enqueue-' . $this->parent->args['opt_name'] );
foreach ( $this->parent->sections as $section ) {
if ( isset( $section['fields'] ) ) {
foreach ( $section['fields'] as $field ) {
if ( isset( $field['type'] ) ) {
$field_classes = array( 'Redux_' . $field['type'], 'ReduxFramework_' . $field['type'] );
$field_class = Redux_Functions::class_exists_ex( $field_classes );
if ( false === $field_class ) {
// phpcs:ignore WordPress.NamingConventions.ValidHookName
$class_file = apply_filters( 'redux-typeclass-load', $this->path . 'inc/fields/' . $field['type'] . '/field_' . $field['type'] . '.php', $field_class );
if ( $class_file ) {
require_once $class_file;
$field_class = Redux_Functions::class_exists_ex( $field_classes );
}
}
if ( class_exists( $field_class ) && method_exists( $field_class, 'enqueue' ) ) {
$enqueue = new $field_class( '', '', $this );
$enqueue->enqueue();
}
}
}
}
}
}
/**
* Register Option for use
*
* @since 1.0.0
* @access public
* @return void
*/
public function register_setting() {
}
/**
* Validate the options before insertion
*
* @param array|string $value The options array.
*
* @return array|string $value
* @since 3.0.0
* @access public
*/
public function field_validation( $value ) {
return $value;
}
}
if ( ! function_exists( 'redux_customizer_custom_validation' ) ) {
/**
* Custom validation.
*
* @param mixed $field Field.
*
* @return mixed
*/
function redux_customizer_custom_validation( $field ) {
return $field;
}
}
}
if ( ! class_exists( 'ReduxFramework_extension_customizer' ) ) {
class_alias( 'Redux_Extension_Customizer', 'ReduxFramework_extension_customizer' );
}

View File

@@ -0,0 +1,98 @@
<?php
/**
* Customizer Control.
*
* @package Redux Framework/Extensions
* @version 3.5
*/
defined( 'ABSPATH' ) || exit;
if ( ! class_exists( 'Redux_Customizer_Control', false ) ) {
/**
* Class Redux_Customizer_Control
*/
class Redux_Customizer_Control extends WP_Customize_Control {
/**
* Redux ID.
*
* @var string
*/
public $redux_id = '';
/**
* Field render.
*/
public function render() {
$this->redux_id = str_replace( 'customize-control-', '', 'customize-control-' . str_replace( '[', '-', str_replace( ']', '', $this->id ) ) );
$class = 'customize-control redux-group-tab redux-field customize-control-' . $this->type;
$opt_name_arr = explode( '[', $this->id );
$opt_name = $opt_name_arr[0];
$field_id = str_replace( ']', '', $opt_name_arr[1] );
$section = Redux_Helpers::section_from_field_id( $opt_name, $field_id );
if ( isset( $section['disabled'] ) && true === $section['disabled'] ) {
$class .= ' disabled';
}
if ( isset( $section['hidden'] ) && true === $section['hidden'] ) {
$class .= ' hidden';
}
?>
<li id="<?php echo esc_attr( $this->redux_id ); ?>-li" class="<?php echo esc_attr( $class ); ?>">
<?php if ( 'repeater' !== $this->type ) { ?>
<input
type="hidden"
data-id="<?php echo esc_attr( $this->id ); ?>"
data-key="<?php echo esc_attr( str_replace( $opt_name . '-', '', $this->redux_id ) ); ?>"
class="redux-customizer-input"
id="customizer_control_id_<?php echo esc_attr( $this->redux_id ); ?>" <?php echo esc_url( $this->get_link() ); ?>
value=""/>
<?php } ?>
<?php $this->render_content(); ?>
</li>
<?php
}
/**
* Render content hook.
*/
public function render_content() {
// phpcs:ignore WordPress.NamingConventions.ValidHookName
do_action( 'redux/customizer/control/render/' . $this->redux_id, $this );
}
/**
* Label output.
*/
public function label() {
// The label has already been sanitized in the Fields class, no need to re-sanitize it.
echo( $this->label ); // phpcs:ignore WordPress.Security.EscapeOutput
}
/**
* Description output.
*/
public function description() {
if ( ! empty( $this->description ) ) {
// The description has already been sanitized in the Fields class, no need to re-sanitize it.
echo '<span class="description customize-control-description">' . esc_html( $this->description ) . '</span>';
}
}
/**
* Title output.
*/
public function title() {
echo '<span class="customize-control-title">';
$this->label();
$this->description();
echo '</span>';
}
}
}

View File

@@ -0,0 +1,237 @@
<?php
/**
* Redux Customizer Panel Class
*
* @class Redux_Customizer_Panel
* @version 4.0.0
* @package Redux Framework/Extentions
*/
defined( 'ABSPATH' ) || exit;
/**
* Customizer section representing widget area (sidebar).
*
* @package WordPress
* @subpackage Customize
* @since 4.1.0
* @see WP_Customize_Section
*/
class Redux_Customizer_Panel extends WP_Customize_Panel {
/**
* Type of this panel.
*
* @since 4.0.0
* @access public
* @var string
*/
public $type = 'redux';
/**
* Panel opt_name.
*
* @since 4.0.0
* @access public
* @var string
*/
public $opt_name = '';
/**
* Section array.
*
* @var array|mixed
*/
public $section = array();
/**
* Constructor.
* Any supplied $args override class property defaults.
*
* @since 4.0.0
*
* @param WP_Customize_Manager $manager Customizer bootstrap instance.
* @param string $id A specific ID for the panel.
* @param array $args Panel arguments.
*/
public function __construct( $manager, $id, $args = array() ) {
parent::__construct( $manager, $id, $args );
// Redux addition.
if ( isset( $args['section'] ) ) {
$this->section = $args['section'];
$this->description = $this->section['desc'] ?? '';
$this->opt_name = $args['opt_name'] ?? '';
}
}
/**
* WP < 4.3 Render
*
* @since
* @access protected
*/
protected function render() {
global $wp_version;
$version = explode( '-', $wp_version );
if ( version_compare( $version[0], '4.3', '<' ) ) {
$this->render_fallback();
}
}
/**
* Render.
*/
protected function render_fallback() {
$classes = 'accordion-section redux-main redux-panel control-section control-panel control-panel-' . esc_attr( $this->type );
?>
<li id="accordion-panel-<?php echo esc_attr( $this->id ); ?>" class="<?php echo esc_attr( $classes ); ?>"
data-width="<?php echo isset( $this->section['customizer_width'] ) ? esc_attr( $this->section['customizer_width'] ) : ''; ?>">
<h3 class="accordion-section-title" tabindex="0">
<?php if ( isset( $this->section['icon'] ) && ! empty( $this->section['icon'] ) ) : ?>
<i class="<?php echo esc_attr( $this->section['icon'] ); ?>"></i>
<?php endif; ?>
<?php
echo wp_kses(
$this->title,
array(
'em' => array(),
'i' => array(),
'strong' => array(),
'span' => array(
'class' => array(),
'style' => array(),
),
)
);
?>
<span class="screen-reader-text"><?php esc_html_e( 'Press return or enter to open this panel', 'redux-framework' ); ?></span>
</h3>
<ul class="accordion-sub-container control-panel-content">
<table class="form-table">
<tbody><?php $this->render_content(); ?></tbody>
</table>
</ul>
</li>
<?php
}
/**
* Render the sections that have been added to the panel.
*
* @since 4.1.0
* @access protected
*/
protected function render_content() {
?>
<li class="panel-meta accordion-section redux-panel redux-panel-meta control-section
<?php
if ( empty( $this->description ) ) {
echo ' cannot-expand';
}
?>
">
<div class="accordion-section-title" tabindex="0">
<span class="preview-notice">
<?php /* translators: %s is the site/panel title in the Customizer */ ?>
<?php printf( esc_html__( 'You are customizing', 'redux-framework' ) . ' %s', '<strong class="panel-title">' . esc_html( $this->title ) . '</strong>' ); ?>
</span>
</div>
<?php if ( ! empty( $this->description ) ) { ?>
<div class="accordion-section-content description legacy">
<?php echo wp_kses_post( $this->description ); ?>
</div>
<?php } ?>
</li>
<?php
}
/**
* JSON.
*
* @return array
*/
public function json(): array {
$array = wp_array_slice_assoc(
parent::json(),
array(
'id',
'title',
'description',
'priority',
'type',
)
);
$array['content'] = $this->get_content();
$array['active'] = $this->active();
$array['instanceNumber'] = $this->instance_number;
// BEGIN Redux Additions.
$array['width'] = $this->section['customizer_width'] ?? '';
$array['icon'] = ( isset( $this->section['icon'] ) && ! empty( $this->section['icon'] ) ) ? $this->section['icon'] : 'hide';
$array['opt_name'] = $this->opt_name;
return $array;
}
/**
* An Underscore (JS) template for this panel's content (but not its container).
* Class variables for this panel class are available in the `data` JS object;
* export custom variables by overriding {@see WP_Customize_Panel::json()}.
*
* @see WP_Customize_Panel::print_template()
* @since 4.3.0
*/
protected function content_template() {
?>
<li
class="panel-meta customize-info redux-customizer-opt-name redux-panel accordion-section <# if ( ! data.description ) { #> cannot-expand<# } #>"
data-opt-name="{{{ data.opt_name }}}">
<button class="customize-panel-back" tabindex="-1">
<span class="screen-reader-text"><?php esc_attr_e( 'Back', 'redux-framework' ); ?></span></button>
<div class="accordion-section-title">
<span class="preview-notice">
<?php /* translators: %s is the site/panel title in the Customizer */ ?>
<?php printf( esc_html__( 'You are customizing', 'redux-framework' ) . ' %s', '<strong class="panel-title">{{ data.title }}</strong>' ); ?>
</span>
<# if ( data.description ) { #>
<button
class="customize-help-toggle dashicons dashicons-editor-help"
tabindex="0"
aria-expanded="false">
<span class="screen-reader-text"><?php esc_attr_e( 'Help', 'redux-framework' ); ?></span></button>
<# } #>
</div>
<# if ( data.description ) { #>
<div class="description customize-panel-description">
{{{ data.description }}}
</div>
<# } #>
</li>
<?php
}
/**
* An Underscore (JS) template for rendering this panel's container.
* Class variables for this panel class are available in the `data` JS object;
* export custom variables by overriding {@see WP_Customize_Panel::json()}.
*
* @see WP_Customize_Panel::print_template()
* @since 4.3.0
*/
protected function render_template() {
?>
<li id="accordion-panel-{{ data.id }}"
class="accordion-section redux-panel control-section control-panel control-panel-{{ data.type }}"
data-width="{{ data.width }}">
<h3 class="accordion-section-title" tabindex="0">
<# if ( data.icon ) { #><i class="{{ data.icon }}"></i> <# } #>{{ data.title }}
<span class="screen-reader-text"><?php echo esc_html__( 'Press return or enter to open this panel', 'redux-framework' ); ?></span>
</h3>
<ul class="accordion-sub-container control-panel-content"></ul>
</li>
<?php
}
}

View File

@@ -0,0 +1,203 @@
<?php
/**
* Customizer section representing widget area (sidebar).
*
* @package WordPress
* @subpackage Customize
* @since 4.0.0
* @see WP_Customize_Section
*/
defined( 'ABSPATH' ) || exit;
/**
* Class Redux_Customizer_Section
*/
class Redux_Customizer_Section extends WP_Customize_Section {
/**
* Type of this section.
*
* @since 4.1.0
* @access public
* @var string
*/
public $type = 'redux';
/**
* Panel opt_name.
*
* @since 4.0.0
* @access public
* @var string
*/
public $opt_name = '';
/**
* Section array.
*
* @var array|mixed
*/
public $section = array();
/**
* Constructor.
* Any supplied $args override class property defaults.
*
* @since 3.4.0
*
* @param WP_Customize_Manager $manager Customizer bootstrap instance.
* @param string $id A specific ID of the section.
* @param array $args Section arguments.
*/
public function __construct( $manager, $id, $args = array() ) {
parent::__construct( $manager, $id, $args );
// Redux addition.
if ( isset( $args['section'] ) ) {
$this->section = $args['section'];
$this->description = $this->section['desc'] ?? '';
$this->opt_name = $args['opt_name'] ?? '';
}
}
/**
* WP < 4.3 Render
*/
protected function render() {
global $wp_version;
$version = explode( '-', $wp_version );
if ( version_compare( $version[0], '4.3', '<' ) ) {
$this->render_fallback();
}
}
/**
* Render the section, and the controls that have been added to it.
*
* @since 3.4.0
*/
protected function render_fallback() {
$classes = 'accordion-section redux-section control-section control-section-' . $this->type;
?>
<li id="accordion-section-<?php echo esc_attr( $this->id ); ?>" class="<?php echo esc_attr( $classes ); ?>">
<h3 class="accordion-section-title" tabindex="0">
<?php
echo wp_kses(
$this->title,
array(
'em' => array(),
'i' => array(),
'strong' => array(),
'span' => array(
'class' => array(),
'style' => array(),
),
)
);
?>
<span class="screen-reader-text"><?php esc_attr_e( 'Press return or enter to expand', 'redux-framework' ); ?></span>
</h3>
<ul class="accordion-section-content redux-main">
<?php
if ( isset( $this->opt_name ) && isset( $this->section ) ) {
// phpcs:ignore WordPress.NamingConventions.ValidHookName
do_action( "redux/page/$this->opt_name/section/before", $this->section );
}
?>
<?php if ( ! empty( $this->description ) ) { ?>
<li class="customize-section-description-container">
<p class="description customize-section-description legacy"><?php echo wp_kses_post( $this->description ); ?></p>
</li>
<?php } ?>
</ul>
</li>
<?php
}
/**
* Gather the parameters passed to client JavaScript via JSON.
*
* @since 4.1.0
*
* @return array The array to be exported to the client as JSON.
*/
public function json(): array {
$array = wp_array_slice_assoc(
parent::json(),
array(
'id',
'title',
'description',
'priority',
'panel',
'type',
)
);
$array['content'] = $this->get_content();
$array['active'] = $this->active();
$array['instanceNumber'] = $this->instance_number;
if ( $this->panel ) {
/* translators: &#9656; is the unicode right-pointing triangle, and %s is the section title in the Customizer */
$array['customizeAction'] = sprintf( __( 'Customizing &#9656; %s', 'redux-framework' ), esc_html( $this->manager->get_panel( $this->panel )->title ) );
} else {
$array['customizeAction'] = __( 'Customizing', 'redux-framework' );
}
// BEGIN Redux Additions.
$array['width'] = $this->section['customizer_width'] ?? '';
$array['icon'] = ( isset( $this->section['icon'] ) && ! empty( $this->section['icon'] ) ) ? $this->section['icon'] : 'hide';
$array['opt_name'] = $this->opt_name;
return $array;
}
/**
* An Underscore (JS) template for rendering this section.
* Class variables for this section class are available in the `data` JS object;
* export custom variables by overriding {@see WP_Customize_Section::json()}.
*
* @see WP_Customize_Section::print_template()
* @since 4.3.0
*/
protected function render_template() {
?>
<li id="accordion-section-{{ data.id }}"
class="redux-standalone-section redux-customizer-opt-name redux-section accordion-section control-section control-section-{{ data.type }}"
data-opt-name="{{ data.opt_name }}"
data-width="{{ data.width }}">
<h3 class="accordion-section-title" tabindex="0">
<# if ( data.icon ) { #><i class="{{ data.icon }}"></i> <# } #>{{ data.title }}
<span class="screen-reader-text"><?php esc_html_e( 'Press return or enter to open', 'redux-framework' ); ?></span>
</h3>
<ul class="accordion-section-content redux-main">
<li class="customize-section-description-container">
<div class="customize-section-title">
<button class="customize-section-back" tabindex="-1">
<span class="screen-reader-text"><?php esc_html_e( 'Back', 'redux-framework' ); ?></span>
</button>
<h3>
<span class="customize-action">
{{{ data.customizeAction }}}
</span> {{ data.title }}
</h3>
</div>
<# if ( data.description ) { #>
<p class="description customize-section-description">{{{ data.description }}}</p>
<# } #>
<?php
if ( isset( $this->opt_name ) && isset( $this->section ) ) {
// phpcs:ignore WordPress.NamingConventions.ValidHookName
do_action( "redux/page/$this->opt_name/section/before", $this->section );
}
?>
</li>
</ul>
</li>
<?php
}
}

View File

@@ -0,0 +1,12 @@
<?php
/**
* Redux Customizer Shim.
*
* Shim for the old way of calling the customizer.
*
* @package Redux
*/
defined( 'ABSPATH' ) || exit;
require_once __DIR__ . '/class-redux-customizer-panel.php';

View File

@@ -0,0 +1,12 @@
<?php
/**
* Redux Customizer Shim.
*
* Shim for the old way of calling the customizer.
*
* @package Redux
*/
defined( 'ABSPATH' ) || exit;
require_once __DIR__ . '/class-redux-customizer-section.php';

View File

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

View File

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

View File

@@ -0,0 +1,59 @@
.wp-customizer .redux-container { overflow: visible; }
.wp-customizer .redux-container .redux-main input { margin: 0 !important; }
.wp-customizer .redux-container .redux-main input.spinner-input { margin-right: 30px !important; margin-left: 30px !important; margin-top: 0 !important; }
.wp-customizer .redux-container .redux-main .redux-container-editor .wp-editor-area { color: #000000; }
.wp-customizer .redux-section.open .redux-group-tab { display: block !important; }
.wp-customizer .redux-section.open .redux-group-tab.hide { display: none !important; }
.wp-customizer .redux-section p.customize-section-description { margin-top: 22px; word-break: break-word; }
.wp-customizer .redux-section p.customize-section-description.legacy { margin-top: 7px; }
.wp-customizer .control-section-themes .accordion-section-title { margin: 0; }
.wp-customizer #customize-controls .description { display: block; }
.wp-customizer #customize-controls .customize-info { margin-bottom: 0; }
.wp-customizer #customize-controls .redux-section .accordion-section-content { background: #fcfcfc; }
.wp-customizer .redux-section .accordion-section-title i, .wp-customizer .redux-field .accordion-field-title i, .wp-customizer .redux-panel .accordion-section-title i { margin-right: 5px; }
.wp-customizer .accordion-section.redux-main { background: inherit; margin-left: inherit; border-left: inherit; -moz-box-shadow: inherit; -webkit-box-shadow: inherit; padding: inherit; box-shadow: inherit; }
.wp-customizer .redux_field_th { padding: 13px 0 0 0; }
.wp-customizer .redux-main .redux-field-container { padding: 10px 0; }
.wp-customizer .redux-main .select_wrapper { float: none; width: 100%; display: inline-block; }
.wp-customizer .redux-main .select2-container { margin-right: 0 !important; margin-bottom: 5px !important; width: 100% !important; }
.wp-customizer .redux-main .select_wrapper:nth-child(odd) { margin-right: 0; }
.wp-customizer .redux-main .redux-option-image { max-width: 42% !important; margin-right: 3%; }
.wp-customizer .redux-main .customize-control { border-bottom: 1px solid #ddd; padding-bottom: 4px; }
.wp-customizer .redux-main .customize-control:last-child { border-bottom: 0; padding-bottom: 0; }
.wp-customizer .redux-main .upload { width: 100% !important; }
.wp-customizer .redux-main h3 { margin-top: inherit; }
.wp-customizer .redux-main .redux-container-raw { margin-top: 22px; word-break: break-word; padding: 0 !important; }
.wp-customizer .redux-main .redux-container-password input { width: 100%; }
.wp-customizer .select2-drop, .wp-customizer .select2-container { z-index: 999999; }
.wp-customizer .customize-control-redux-raw { list-style: none; }
/*# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVkdXgtZXh0ZW5zaW9uLWN1c3RvbWl6ZXIuY3NzIiwic291cmNlcyI6WyJyZWR1eC1leHRlbnNpb24tY3VzdG9taXplci5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLEFBQ0ksY0FEVSxDQUNWLGdCQUFnQixDQUFDLEVBQ2IsUUFBUSxFQUFFLE9BQU8sR0FrQnBCOztBQXBCTCxBQUlZLGNBSkUsQ0FDVixnQkFBZ0IsQ0FFWixXQUFXLENBQ1AsS0FBSyxDQUFDLEVBQ0YsTUFBTSxFQUFFLFlBQVksR0FDdkI7O0FBTmIsQUFRWSxjQVJFLENBQ1YsZ0JBQWdCLENBRVosV0FBVyxDQUtQLEtBQUssQUFBQSxjQUFjLEN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R0FDZDs7QUF0SFQsQUF5SEksY0F6SFUsQ0F5SFYsYUFBYSxFQXpIakIsY0FBYyxDQTBIVixrQkFBa0IsQ0FBQyxFQUNmLE9BQU8sRUFBRSxNQUFNLEdBQ2xCOztBQTVITCxBQThISSxjQTlIVSxDQThIViw0QkFBNEIsQ0FBQyxFQUN6QixVQUFVLEVBQUUsSUFBSSxHQUNuQiJ9 */
/*# sourceMappingURL=redux-extension-customizer.css.map */

View File

@@ -0,0 +1,233 @@
/* global jQuery, document, redux, redux_change:true, wp, ajaxurl */
(function ( $ ) {
'use strict';
redux.customizer = redux.customizer || {};
$( document ).ready(
function () {
redux.customizer.init();
}
);
redux.customizer.init = function () {
var reduxChange;
var redux_initFields;
$( 'body' ).addClass( redux.customizer.body_class );
$( '.accordion-section.redux-section, .accordion-section.redux-panel, .accordion-section-title' ).on(
'click',
function () {
$.redux.initFields();
}
);
$( '.accordion-section.redux-section h3, .accordion-section.redux-panel h3' ).on(
'click',
function () {
redux.customizer.resize( $( this ).parent() );
}
);
if ( undefined === redux.optName ) {
console.log( 'Redux customizer extension failure' );
return;
}
$( '.control-panel-back, .customize-panel-back' ).on(
'click',
function () {
$( document ).find( 'form#customize-controls' ).removeAttr( 'style' );
$( document ).find( '.wp-full-overlay' ).removeAttr( 'style' );
redux.customizer.width = 0;
}
);
$( '.control-section-back, .customize-section-back' ).on(
'click',
function () {
redux.customizer.resize( $( this ).parent().parent().parent() );
}
);
if ( redux.customizer ) {
// Customizer save hook.
$( '#customize-save-button-wrapper #save' ).on(
'click',
function () {
setTimeout(
function () {
var $parent = $( document.getElementById( 'customize-controls' ) );
var $data = $parent.serialize();
var nonce = $( '.redux-customizer-nonce' ).data( 'nonce' );
$.ajax(
{
type: 'post',
dataType: 'json',
url: ajaxurl,
data: {
action: redux.optName.args.opt_name + '_customizer_save',
nonce: nonce,
opt_name: redux.optName.args.opt_name,
data: $data
},
error: function ( response ) {
if ( true === redux.optName.args.dev_mode ) {
console.log( response.responseText );
}
},
success: function ( response ) {
if ( 'success' === response.status ) {
console.log( response );
$( '.redux-action_bar .spinner' ).removeClass( 'is-active' );
redux.optName.options = response.options;
redux.optName.errors = response.errors;
redux.optName.warnings = response.warnings;
redux.optName.sanitize = response.sanitize;
if ( null !== response.errors || null !== response.warnings ) {
$.redux.notices();
}
if ( null !== response.sanitize ) {
$.redux.sanitize();
}
} else {
console.log( response.responseText );
}
}
}
);
},
1000
);
}
);
}
redux.optName.args.disable_save_warn = true;
reduxChange = redux_change;
redux_change = function ( variable ) {
variable = $( variable );
reduxChange.apply( this, arguments );
redux.customizer.save( variable );
};
redux_initFields = $.redux.initFields;
$.redux.initFiles = function () {
redux_initFields();
};
};
redux.customizer.resize = function ( el ) {
var width;
var test;
var id;
var parentId;
if ( el.attr( 'data-width' ) ) {
redux.customizer.width = el.attr( 'data-width' );
width = redux.customizer.width;
} else {
width = redux.customizer.width;
}
if ( $( 'body' ).width() < 640 ) {
width = '';
}
if ( '' !== width ) {
test = $( '#' + el.attr( 'aria-owns' ) );
if ( test.length > 0 ) {
el = test;
}
}
if ( el.hasClass( 'open' ) || el.hasClass( 'current-panel' ) || el.hasClass( 'current-section' ) ) {
if ( '' !== width ) {
$( document ).find( 'form#customize-controls' ).attr(
'style',
'width:' + width + ';'
);
$( document ).find( '.wp-full-overlay' ).attr(
'style',
'margin-left:' + width + ';'
);
}
} else {
id = el.attr( 'id' );
parentId = $( '*[aria-owns="' + id + '"]' ).parents( '.redux-panel:first' ).attr( 'id' );
width = $( '*[aria-owns="' + parentId + '"]' ).attr( 'data-width' );
if ( ! width ) {
$( document ).find( 'form#customize-controls' ).removeAttr( 'style' );
$( document ).find( '.wp-full-overlay' ).removeAttr( 'style' );
} else {
$( document ).find( 'form#customize-controls' ).attr(
'style',
'width:' + width + ';'
);
$( document ).find( '.wp-full-overlay' ).attr(
'style',
'margin-left:' + width + ';'
);
}
}
};
redux.customizer.save = function ( $obj ) {
var $parent = $obj.hasClass( 'redux-field' ) ? $obj : $obj.parents( '.redux-field-container:first' );
redux.customizer.inputSave( $parent );
};
redux.customizer.inputSave = function ( $parent ) {
var $id;
var $nData;
var $key;
var $control;
if ( ! $parent.hasClass( 'redux-field-container' ) ) {
$parent = $parent.parents( '[class^="redux-field-container"]' );
}
$id = $parent.parent().find( '.redux-customizer-input' ).data( 'id' );
if ( ! $id ) {
$parent = $parent.parents( '.redux-container-repeater:first' );
$id = $parent.parent().find( '.redux-customizer-input' ).data( 'id' );
}
$nData = $parent.find( ':input' ).serializeJSON();
$.each(
$nData,
function ( $k, $v ) {
$k = null;
$nData = $v;
}
);
$key = $parent.parent().find( '.redux-customizer-input' ).data( 'key' );
if ( $nData[$key] ) {
$nData = $nData[$key];
}
$control = wp.customize.control( $id );
// Customizer hack since they didn't code it to save order...
if ( JSON.stringify( $control.setting._value ) !== JSON.stringify( $nData ) ) {
$control.setting._value = null;
}
$control.setting.set( $nData );
};
})( jQuery );

View File

@@ -0,0 +1 @@
!function(n){"use strict";redux.customizer=redux.customizer||{},n(document).ready(function(){redux.customizer.init()}),redux.customizer.init=function(){var t,e;n("body").addClass(redux.customizer.body_class),n(".accordion-section.redux-section, .accordion-section.redux-panel, .accordion-section-title").on("click",function(){n.redux.initFields()}),n(".accordion-section.redux-section h3, .accordion-section.redux-panel h3").on("click",function(){redux.customizer.resize(n(this).parent())}),void 0===redux.optName?console.log("Redux customizer extension failure"):(n(".control-panel-back, .customize-panel-back").on("click",function(){n(document).find("form#customize-controls").removeAttr("style"),n(document).find(".wp-full-overlay").removeAttr("style"),redux.customizer.width=0}),n(".control-section-back, .customize-section-back").on("click",function(){redux.customizer.resize(n(this).parent().parent().parent())}),redux.customizer&&n("#customize-save-button-wrapper #save").on("click",function(){setTimeout(function(){var e=n(document.getElementById("customize-controls")).serialize(),t=n(".redux-customizer-nonce").data("nonce");n.ajax({type:"post",dataType:"json",url:ajaxurl,data:{action:redux.optName.args.opt_name+"_customizer_save",nonce:t,opt_name:redux.optName.args.opt_name,data:e},error:function(e){!0===redux.optName.args.dev_mode&&console.log(e.responseText)},success:function(e){"success"===e.status?(console.log(e),n(".redux-action_bar .spinner").removeClass("is-active"),redux.optName.options=e.options,redux.optName.errors=e.errors,redux.optName.warnings=e.warnings,redux.optName.sanitize=e.sanitize,null===e.errors&&null===e.warnings||n.redux.notices(),null!==e.sanitize&&n.redux.sanitize()):console.log(e.responseText)}})},1e3)}),redux.optName.args.disable_save_warn=!0,t=redux_change,redux_change=function(e){e=n(e),t.apply(this,arguments),redux.customizer.save(e)},e=n.redux.initFields,n.redux.initFiles=function(){e()})},redux.customizer.resize=function(e){e.attr("data-width")&&(redux.customizer.width=e.attr("data-width"));var t,r=redux.customizer.width;(e=""!==(r=n("body").width()<640?"":r)&&0<(t=n("#"+e.attr("aria-owns"))).length?t:e).hasClass("open")||e.hasClass("current-panel")||e.hasClass("current-section")?""!==r&&(n(document).find("form#customize-controls").attr("style","width:"+r+";"),n(document).find(".wp-full-overlay").attr("style","margin-left:"+r+";")):(t=e.attr("id"),e=n('*[aria-owns="'+t+'"]').parents(".redux-panel:first").attr("id"),(r=n('*[aria-owns="'+e+'"]').attr("data-width"))?(n(document).find("form#customize-controls").attr("style","width:"+r+";"),n(document).find(".wp-full-overlay").attr("style","margin-left:"+r+";")):(n(document).find("form#customize-controls").removeAttr("style"),n(document).find(".wp-full-overlay").removeAttr("style")))},redux.customizer.save=function(e){e=e.hasClass("redux-field")?e:e.parents(".redux-field-container:first");redux.customizer.inputSave(e)},redux.customizer.inputSave=function(e){var t=(t=(e=e.hasClass("redux-field-container")?e:e.parents('[class^="redux-field-container"]')).parent().find(".redux-customizer-input").data("id"))||(e=e.parents(".redux-container-repeater:first")).parent().find(".redux-customizer-input").data("id"),r=e.find(":input").serializeJSON();n.each(r,function(e,t){r=t}),e=e.parent().find(".redux-customizer-input").data("key"),r[e]&&(r=r[e]),e=wp.customize.control(t),JSON.stringify(e.setting._value)!==JSON.stringify(r)&&(e.setting._value=null),e.setting.set(r)}}(jQuery);

View File

@@ -0,0 +1,130 @@
.wp-customizer {
.redux-container {
overflow: visible;
.redux-main {
input {
margin: 0 !important;
}
input.spinner-input {
margin-right: 30px !important;
margin-left: 30px !important;
margin-top: 0 !important;
}
.redux-container-editor {
.wp-editor-area {
color:#000000;
}
}
}
}
.redux-section.open .redux-group-tab {
display: block !important;
&.hide {
display:none!important;
}
}
.redux-section {
p.customize-section-description {
margin-top: 22px;
word-break: break-word;
&.legacy {
margin-top: 7px;
}
}
}
.control-section-themes .accordion-section-title {
margin: 0;
}
#customize-controls {
.description {
display: block;
}
.customize-info {
margin-bottom: 0;
}
.redux-section .accordion-section-content {
background: #fcfcfc;
}
}
.redux-section .accordion-section-title i,
.redux-field .accordion-field-title i,
.redux-panel .accordion-section-title i {
margin-right: 5px;
}
.accordion-section.redux-main {
background: inherit;
margin-left: inherit;
border-left: inherit;
-moz-box-shadow: inherit;
-webkit-box-shadow: inherit;
padding: inherit;
box-shadow: inherit;
}
.redux_field_th {
padding: 13px 0 0 0;
}
.redux-main {
.redux-field-container {
padding: 10px 0;
}
.select_wrapper {
float: none;
width: 100%;
display: inline-block;
}
.select2-container {
margin-right: 0 !important;
margin-bottom: 5px !important;
width: 100% !important;
}
.select_wrapper:nth-child(odd) {
margin-right: 0;
}
.redux-option-image {
max-width: 42% !important;
margin-right: 3%;
}
.customize-control {
border-bottom: 1px solid #ddd;
padding-bottom: 4px;
}
.customize-control:last-child {
border-bottom: 0;
padding-bottom: 0;
}
.upload {
width: 100% !important;
}
h3 {
margin-top: inherit;
}
.redux-container-raw {
margin-top: 22px;
word-break: break-word;
padding: 0 !important;
}
.redux-container-password input {
width: 100%;
}
}
.select2-drop,
.select2-container {
z-index: 999999;
}
.customize-control-redux-raw {
list-style: none;
}
}