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:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,576 @@
|
||||
<?php // phpcs:ignore WordPress.NamingConventions.ValidFunctionName
|
||||
/**
|
||||
* Redux Framework User Meta API Class
|
||||
* Makes instantiating a Redux object an absolute piece of cake.
|
||||
*
|
||||
* @package Redux_Framework
|
||||
* @author Dovy Paukstys
|
||||
* @subpackage Users
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
// Don't duplicate me!
|
||||
if ( ! class_exists( 'Redux_Users' ) ) {
|
||||
|
||||
/**
|
||||
* Redux Users API Class
|
||||
* Simple API for Redux Framework
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class Redux_Users {
|
||||
|
||||
/**
|
||||
* Profile array.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $profiles = array();
|
||||
|
||||
/**
|
||||
* Sections array.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $sections = array();
|
||||
|
||||
/**
|
||||
* Fields array.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $fields = array();
|
||||
|
||||
/**
|
||||
* Priority array.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $priority = array();
|
||||
|
||||
/**
|
||||
* Errors array.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $errors = array();
|
||||
|
||||
/**
|
||||
* Init array.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $init = array();
|
||||
|
||||
/**
|
||||
* Args array.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $args = array();
|
||||
|
||||
/**
|
||||
* Load.
|
||||
*/
|
||||
public static function load() {
|
||||
add_action( 'init', array( 'Redux_Users', 'enqueue' ), 99 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue support files and fields.
|
||||
*
|
||||
* @throws ReflectionException Exception.
|
||||
*/
|
||||
public static function enqueue() {
|
||||
global $pagenow;
|
||||
|
||||
// Check and run instances of Redux where the opt_name hasn't been run.
|
||||
$pagenows = array( 'user-new.php', 'profile.php', 'user-edit.php' );
|
||||
|
||||
if ( ! empty( self::$sections ) && in_array( $pagenow, $pagenows, true ) ) {
|
||||
$instances = ReduxFrameworkInstances::get_all_instances();
|
||||
|
||||
foreach ( self::$fields as $opt_name => $fields ) {
|
||||
if ( ! isset( $instances[ $opt_name ] ) ) {
|
||||
Redux::set_args( $opt_name, array( 'menu_type' => 'hidden' ) );
|
||||
Redux::set_sections(
|
||||
$opt_name,
|
||||
array(
|
||||
array(
|
||||
'id' => 'EXTENSION_USERS_FAKE_ID' . $opt_name,
|
||||
'fields' => $fields,
|
||||
'title' => 'N/A',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
Redux::init( $opt_name );
|
||||
|
||||
$instances = ReduxFrameworkInstances::get_all_instances();
|
||||
}
|
||||
|
||||
self::check_opt_name( $opt_name );
|
||||
|
||||
Redux::set_args( $opt_name, self::$args[ $opt_name ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct Args.
|
||||
*
|
||||
* @param string $opt_name Panel Opt Name.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public static function construct_args( string $opt_name ) {
|
||||
$args = self::$args[ $opt_name ];
|
||||
$args['opt_name'] = $opt_name;
|
||||
|
||||
if ( ! isset( $args['menu_title'] ) ) {
|
||||
$args['menu_title'] = ucfirst( $opt_name ) . ' Options';
|
||||
}
|
||||
|
||||
if ( ! isset( $args['page_title'] ) ) {
|
||||
$args['page_title'] = ucfirst( $opt_name ) . ' Options';
|
||||
}
|
||||
|
||||
if ( ! isset( $args['page_slug'] ) ) {
|
||||
$args['page_slug'] = $opt_name . '_options';
|
||||
}
|
||||
|
||||
return $args;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct Profiles.
|
||||
*
|
||||
* @param string $opt_name Panel opt_name.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function construct_profiles( string $opt_name ): array {
|
||||
$profiles = array();
|
||||
|
||||
if ( ! isset( self::$profiles[ $opt_name ] ) ) {
|
||||
return $profiles;
|
||||
}
|
||||
|
||||
foreach ( self::$profiles[ $opt_name ] as $profile ) {
|
||||
$profile['sections'] = self::construct_sections( $opt_name, $profile['id'] );
|
||||
$profiles[] = $profile;
|
||||
}
|
||||
|
||||
ksort( $profiles );
|
||||
|
||||
return $profiles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct Sections.
|
||||
*
|
||||
* @param string $opt_name Panel opt_name.
|
||||
* @param int|string $profile_id Profile ID.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function construct_sections( string $opt_name, $profile_id ): array {
|
||||
$sections = array();
|
||||
|
||||
if ( ! isset( self::$sections[ $opt_name ] ) ) {
|
||||
return $sections;
|
||||
}
|
||||
|
||||
foreach ( self::$sections[ $opt_name ] as $section_id => $section ) {
|
||||
if ( $section['profile_id'] === $profile_id ) {
|
||||
self::$sections[ $opt_name ][ $section_id ]['roles'] = $section;
|
||||
|
||||
$p = $section['priority'];
|
||||
|
||||
while ( isset( $sections[ $p ] ) ) {
|
||||
echo esc_html( $p++ );
|
||||
}
|
||||
|
||||
$section['fields'] = self::construct_fields( $opt_name, $section_id );
|
||||
$sections[ $p ] = $section;
|
||||
}
|
||||
}
|
||||
|
||||
return $sections;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct Fields.
|
||||
*
|
||||
* @param string $opt_name Panel opt_name.
|
||||
* @param string $section_id Section ID.
|
||||
* @param bool $permissions Permissions.
|
||||
* @param bool $roles Roles.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function construct_fields( string $opt_name = '', string $section_id = '', bool $permissions = false, bool $roles = false ): array {
|
||||
$fields = array();
|
||||
|
||||
if ( ! isset( self::$fields[ $opt_name ] ) ) {
|
||||
return $fields;
|
||||
}
|
||||
|
||||
foreach ( self::$fields[ $opt_name ] as $key => $field ) {
|
||||
// Nested permissions.
|
||||
$field['permissions'] = $field['permissions'] ?? $permissions;
|
||||
|
||||
self::$fields[ $opt_name ][ $key ]['permissions'] = $field['permissions'];
|
||||
|
||||
// Nested roles permissions.
|
||||
$field['roles'] = $field['roles'] ?? $roles;
|
||||
|
||||
self::$fields[ $opt_name ][ $key ]['roles'] = $field['roles'];
|
||||
|
||||
if ( $field['section_id'] === $section_id ) {
|
||||
$p = $field['priority'];
|
||||
|
||||
while ( isset( $fields[ $p ] ) ) {
|
||||
echo esc_html( $p++ );
|
||||
}
|
||||
|
||||
$fields[ $p ] = $field;
|
||||
}
|
||||
}
|
||||
|
||||
ksort( $fields );
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Section.
|
||||
*
|
||||
* @param string $opt_name Panel opt_name.
|
||||
* @param string $id ID.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function get_section( string $opt_name = '', string $id = '' ): bool {
|
||||
self::check_opt_name( $opt_name );
|
||||
|
||||
if ( ! empty( $opt_name ) && ! empty( $id ) ) {
|
||||
if ( ! isset( self::$sections[ $opt_name ][ $id ] ) ) {
|
||||
$id = strtolower( sanitize_html_class( $id ) );
|
||||
}
|
||||
|
||||
return self::$sections[ $opt_name ][ $id ] ?? false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set args.
|
||||
*
|
||||
* @param string $opt_name Panel opt_name.
|
||||
* @param array $args Args array.
|
||||
*/
|
||||
public static function set_args( string $opt_name = '', array $args = array() ) {
|
||||
self::check_opt_name( $opt_name );
|
||||
|
||||
if ( ! empty( $opt_name ) && is_array( $args ) && ! empty( $args ) ) {
|
||||
self::$args[ $opt_name ] = self::$args[ $opt_name ] ?? array();
|
||||
self::$args[ $opt_name ] = wp_parse_args( $args, self::$args[ $opt_name ] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Section.
|
||||
*
|
||||
* @param string $opt_name Panel opt_name.
|
||||
* @param array $section Section array.
|
||||
*/
|
||||
public static function set_section( string $opt_name = '', array $section = array() ) {
|
||||
self::check_opt_name( $opt_name );
|
||||
|
||||
if ( ! empty( $opt_name ) && is_array( $section ) && ! empty( $section ) ) {
|
||||
if ( ! isset( $section['id'] ) ) {
|
||||
if ( isset( $section['title'] ) ) {
|
||||
$section['id'] = strtolower( sanitize_html_class( $section['title'] ) );
|
||||
} else {
|
||||
$section['id'] = 'section';
|
||||
}
|
||||
|
||||
if ( isset( self::$sections[ $opt_name ][ $section['id'] ] ) ) {
|
||||
$orig = $section['id'];
|
||||
$i = 0;
|
||||
|
||||
while ( isset( self::$sections[ $opt_name ][ $section['id'] ] ) ) {
|
||||
$section['id'] = $orig . '_' . $i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! isset( $section['priority'] ) ) {
|
||||
$section['priority'] = self::get_priority( $opt_name, 'sections' );
|
||||
}
|
||||
|
||||
if ( isset( $section['fields'] ) ) {
|
||||
if ( ! empty( $section['fields'] ) && is_array( $section['fields'] ) ) {
|
||||
if ( isset( $section['permissions'] ) || isset( $section['roles'] ) ) {
|
||||
foreach ( $section['fields'] as $key => $field ) {
|
||||
if ( ! isset( $field['permissions'] ) && isset( $section['permissions'] ) ) {
|
||||
$section['fields'][ $key ]['permissions'] = $section['permissions'];
|
||||
}
|
||||
|
||||
if ( ! isset( $field['roles'] ) && isset( $section['roles'] ) ) {
|
||||
$section['fields'][ $key ]['roles'] = $section['roles'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self::process_fields_array( $opt_name, $section['id'], $section['fields'] );
|
||||
}
|
||||
|
||||
unset( $section['fields'] );
|
||||
}
|
||||
|
||||
self::$sections[ $opt_name ][ $section['id'] ] = $section;
|
||||
} else {
|
||||
self::$errors[ $opt_name ]['section']['empty'] = esc_html__( 'Unable to create a section due an empty section array or the section variable passed was not an array.', 'redux-framework' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Process Section Array.
|
||||
*
|
||||
* @param string $opt_name Panel opt_name.
|
||||
* @param string $profile_id Profile ID.
|
||||
* @param array $sections Sections array.
|
||||
*/
|
||||
public static function process_sections_array( string $opt_name = '', string $profile_id = '', array $sections = array() ) {
|
||||
if ( ! empty( $opt_name ) && ! empty( $profile_id ) && is_array( $sections ) && ! empty( $sections ) ) {
|
||||
foreach ( $sections as $section ) {
|
||||
if ( ! is_array( $section ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$section['profile_id'] = $profile_id;
|
||||
|
||||
if ( ! isset( $section['fields'] ) || ! is_array( $section['fields'] ) ) {
|
||||
$section['fields'] = array();
|
||||
}
|
||||
|
||||
self::set_section( $opt_name, $section );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Process Fields Array.
|
||||
*
|
||||
* @param string $opt_name Panel opt_name.
|
||||
* @param string $section_id Section ID.
|
||||
* @param array $fields Fields array.
|
||||
*/
|
||||
public static function process_fields_array( string $opt_name = '', string $section_id = '', array $fields = array() ) {
|
||||
if ( ! empty( $opt_name ) && ! empty( $section_id ) && is_array( $fields ) && ! empty( $fields ) ) {
|
||||
foreach ( $fields as $field ) {
|
||||
if ( ! is_array( $field ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$field['section_id'] = $section_id;
|
||||
|
||||
self::set_field( $opt_name, $field );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get field.
|
||||
*
|
||||
* @param string $opt_name Panel opt_name.
|
||||
* @param string $id Field ID.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function get_field( string $opt_name = '', string $id = '' ): bool {
|
||||
self::check_opt_name( $opt_name );
|
||||
|
||||
if ( ! empty( $opt_name ) && ! empty( $id ) ) {
|
||||
return self::$fields[ $opt_name ][ $id ] ?? false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set field.
|
||||
*
|
||||
* @param string $opt_name Panel opt_name.
|
||||
* @param array $field Field array.
|
||||
*/
|
||||
public static function set_field( string $opt_name = '', array $field = array() ) {
|
||||
self::check_opt_name( $opt_name );
|
||||
|
||||
if ( ! empty( $opt_name ) && is_array( $field ) && ! empty( $field ) ) {
|
||||
if ( ! isset( $field['priority'] ) ) {
|
||||
$field['priority'] = self::get_priority( $opt_name, 'fields' );
|
||||
}
|
||||
|
||||
self::$fields[ $opt_name ][ $field['id'] ] = $field;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Profile.
|
||||
*
|
||||
* @param string $opt_name Panel opt_name.
|
||||
* @param array $profile Profile array.
|
||||
*/
|
||||
public static function set_profile( string $opt_name = '', array $profile = array() ) {
|
||||
self::check_opt_name( $opt_name );
|
||||
|
||||
if ( ! empty( $opt_name ) && is_array( $profile ) && ! empty( $profile ) ) {
|
||||
if ( ! isset( $profile['id'] ) ) {
|
||||
if ( isset( $profile['title'] ) ) {
|
||||
$profile['id'] = strtolower( sanitize_html_class( $profile['title'] ) );
|
||||
} else {
|
||||
$profile['id'] = 'profile';
|
||||
}
|
||||
|
||||
if ( isset( self::$profiles[ $opt_name ][ $profile['id'] ] ) ) {
|
||||
$orig = $profile['id'];
|
||||
$i = 0;
|
||||
|
||||
while ( isset( self::$profiles[ $opt_name ][ $profile['id'] ] ) ) {
|
||||
$profile['id'] = $orig . '_' . $i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset( $profile['sections'] ) ) {
|
||||
if ( ! empty( $profile['sections'] ) && is_array( $profile['sections'] ) ) {
|
||||
if ( isset( $profile['permissions'] ) || isset( $profile['roles'] ) ) {
|
||||
foreach ( $profile['sections'] as $key => $section ) {
|
||||
if ( ! isset( $section['permissions'] ) && isset( $profile['permissions'] ) ) {
|
||||
$profile['sections'][ $key ]['permissions'] = $profile['permissions'];
|
||||
}
|
||||
|
||||
if ( ! isset( $section['roles'] ) && isset( $profile['roles'] ) ) {
|
||||
$profile['sections'][ $key ]['roles'] = $profile['roles'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self::process_sections_array( $opt_name, $profile['id'], $profile['sections'] );
|
||||
}
|
||||
|
||||
unset( $profile['sections'] );
|
||||
}
|
||||
|
||||
self::$profiles[ $opt_name ][ $profile['id'] ] = $profile;
|
||||
} else {
|
||||
self::$errors[ $opt_name ]['profile']['empty'] = esc_html__( 'Unable to create a profile due an empty profile array or the profile variable passed was not an array.', 'redux-framework' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Priority.
|
||||
*
|
||||
* @param string $opt_name Panel opt_name.
|
||||
* @param mixed $type Type.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public static function get_priority( string $opt_name, $type ) {
|
||||
$priority = self::$priority[ $opt_name ][ $type ];
|
||||
self::$priority[ $opt_name ][ $type ] += 1;
|
||||
|
||||
return $priority;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check opt name.
|
||||
*
|
||||
* @param string $opt_name Panel opt_name.
|
||||
*/
|
||||
public static function check_opt_name( string $opt_name = '' ) {
|
||||
if ( empty( $opt_name ) || is_array( $opt_name ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! isset( self::$profiles[ $opt_name ] ) ) {
|
||||
self::$profiles[ $opt_name ] = array();
|
||||
}
|
||||
|
||||
if ( ! isset( self::$priority[ $opt_name ] ) ) {
|
||||
self::$priority[ $opt_name ]['args'] = 1;
|
||||
}
|
||||
|
||||
if ( ! isset( self::$sections[ $opt_name ] ) ) {
|
||||
self::$sections[ $opt_name ] = array();
|
||||
self::$priority[ $opt_name ]['sections'] = 1;
|
||||
}
|
||||
|
||||
if ( ! isset( self::$fields[ $opt_name ] ) ) {
|
||||
self::$fields[ $opt_name ] = array();
|
||||
self::$priority[ $opt_name ]['fields'] = 1;
|
||||
}
|
||||
|
||||
if ( ! isset( self::$errors[ $opt_name ] ) ) {
|
||||
self::$errors[ $opt_name ] = array();
|
||||
}
|
||||
|
||||
if ( ! isset( self::$init[ $opt_name ] ) ) {
|
||||
self::$init[ $opt_name ] = false;
|
||||
}
|
||||
|
||||
if ( ! isset( self::$args[ $opt_name ] ) ) {
|
||||
self::$args[ $opt_name ] = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get USer Meta.
|
||||
*
|
||||
* @param array $args Args array.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public static function get_user_meta( array $args = array() ) {
|
||||
$default = array(
|
||||
'key' => '',
|
||||
'opt_name' => '',
|
||||
'user' => '',
|
||||
);
|
||||
|
||||
$args = wp_parse_args( $args, $default );
|
||||
|
||||
if ( empty( $args['user'] ) ) {
|
||||
$args['user'] = get_current_user_id();
|
||||
}
|
||||
|
||||
// phpcs:ignore WordPress.PHP.DontExtract
|
||||
extract( $args );
|
||||
|
||||
$single = ! empty( $key );
|
||||
|
||||
$meta = get_user_meta( $user, $key, $single );
|
||||
|
||||
if ( $single ) { // phpcs:ignore Generic.CodeAnalysis.EmptyStatement
|
||||
// Do nothing.
|
||||
} elseif ( ! empty( $meta ) ) {
|
||||
foreach ( $meta as $key => $value ) {
|
||||
if ( is_array( $value ) ) {
|
||||
$value = $value[0];
|
||||
}
|
||||
|
||||
$meta[ $key ] = maybe_unserialize( $value );
|
||||
}
|
||||
}
|
||||
|
||||
return $meta;
|
||||
}
|
||||
}
|
||||
|
||||
Redux_Users::load();
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* Silence is golden.
|
||||
*
|
||||
* @package Redux Framework
|
||||
*/
|
||||
|
||||
echo null;
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,76 @@
|
||||
/**
|
||||
* Redux Users
|
||||
* Dependencies: jquery
|
||||
* Created by: Dovy Paukstys
|
||||
* Date: 19 Feb. 2016
|
||||
*/
|
||||
|
||||
/* global redux */
|
||||
|
||||
jQuery(
|
||||
function ( $ ) {
|
||||
'use strict';
|
||||
|
||||
$.reduxUsers = $.reduxUsers || {};
|
||||
|
||||
$( document ).ready(
|
||||
function () {
|
||||
$.reduxUsers.init();
|
||||
}
|
||||
);
|
||||
|
||||
$.reduxUsers.init = function () {
|
||||
var reduxObject;
|
||||
var optName = $( '.redux-ajax-security' ).data( 'opt-name' );
|
||||
|
||||
if ( undefined === optName ) {
|
||||
reduxObject = redux.optName;
|
||||
} else {
|
||||
reduxObject = redux;
|
||||
}
|
||||
|
||||
$.reduxUsers.notLoaded = true;
|
||||
$.redux.initFields();
|
||||
|
||||
reduxObject.args.ajax_save = 0;
|
||||
reduxObject.args.disable_save_warn = true;
|
||||
};
|
||||
|
||||
// Check for a successful element added since WP ajax doesn't have a callback.
|
||||
$.reduxUsers.editCount = $( '#the-list tr' );
|
||||
|
||||
$.reduxUsers.editCheck = function () {
|
||||
var len;
|
||||
|
||||
if ( $( '#ajax-response .error' ).length ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
len = $( '#the-list tr' ).length;
|
||||
|
||||
if ( len > $.reduxUsers.editCount ) {
|
||||
window.location.reload();
|
||||
return false;
|
||||
}
|
||||
|
||||
setTimeout( $.reduxUsers.editCheck, 100 );
|
||||
|
||||
$.reduxUsers.editCount = len;
|
||||
};
|
||||
|
||||
$( '#submit' ).on(
|
||||
'click',
|
||||
function () {
|
||||
window.onbeforeunload = null;
|
||||
|
||||
$.reduxUsers.editCount = $( '#the-list tr' ).length;
|
||||
|
||||
$( document ).ajaxSuccess(
|
||||
function () {
|
||||
$.reduxUsers.editCheck();
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1 @@
|
||||
.wrap{margin-top:10px}.redux-main{min-height:0 !important}.redux-users.edit-page .redux-group-tab{margin-bottom:10px !important}.redux-users.edit-page .redux-main .redux_field_th{width:100% !important;float:none;padding-top:0}.redux-users.edit-page .redux-main .redux_field{width:100%}.redux-users.edit-page .redux-main .redux-field-container{padding:10px 0 0 0}.redux-container{display:block;margin-top:10px}.redux-container .redux-section-title{padding-left:0 !important;margin-bottom:0 !important}.redux-container .redux-field-container{padding:10px 0 0 !important}.redux-container .redux-section-desc{margin-bottom:20px}.redux-container .redux_main input[type=text]{width:95%}.redux-container .redux-group-tab h3:first-child{margin-top:0}.redux-container.redux-has-sections .redux-group-tab{margin-bottom:0 !important}.redux-container.redux-has-sections .redux-main{background:#fff}.redux-container.redux-has-sections .redux-main span.description{padding-bottom:20px}.redux-container.redux-has-sections .redux-field-container{padding:10px 0 20px !important}.redux-container.redux-no-sections .redux-field-container{padding:10px 0 20px !important}.redux-container.redux-no-sections .redux-main{padding:6px 15px 15px 15px !important;margin-left:0;border-left:0}.redux-container.redux-no-sections .redux-main .default_br{display:none}.redux-container.redux-no-sections .redux-main .form-table th,.redux-container.redux-no-sections .redux-main .form-table td{width:100%}.redux-container.redux-wp-style{-webkit-box-shadow:0 0 !important;box-shadow:0 0 !important;border:0;background:0}.redux-container.redux-wp-style .redux-field-container{padding:10px 0 0 !important}.redux-container.redux-wp-style .redux-group-tab h3{border-bottom-color:#ddd}.redux-container.redux-wp-style .redux-main{-webkit-box-shadow:none;box-shadow:none;background:0;margin-left:inherit;padding:inherit;border-left:none !important;min-height:0 !important}.redux-container.redux-wp-style .redux-main .form-table tr{border-bottom:0}.redux-container.redux-wp-style .redux-main .redux-field-container{padding:5px 0 !important}.redux-container.redux-wp-style .redux-main .redux_field_th{width:210px;float:left}.redux-container.redux-wp-style .redux-main .redux_field{width:70%}.redux-container.redux-wp-style .redux-main img{max-width:99% !important}.redux-container.redux-wp-style .redux-main tr:last-child{border-bottom:0}.redux-container.redux-wp-style .redux-main tr:last-child th,.redux-container.redux-wp-style .redux-main tr:last-child td{padding-bottom:0}.redux-container.redux-wp-style .redux-main tr td{padding-top:10px !important;width:100%}.redux-container.redux-wp-style .redux-main .form-table:first-child tr:first-child td{padding-top:0 !important}.redux-container.redux-wp-style .redux-main .redux-field{margin-bottom:10px !important}.redux-container.redux-wp-style .redux-main .redux-field:last-child{margin-bottom:0 !important}.redux-container .redux-group-tab h3{cursor:text !important;-webkit-user-select:inherit !important;-moz-user-select:inherit !important;-ms-user-select:inherit !important;user-select:inherit !important;padding-left:0 !important;margin-top:10px}.display-group{display:inherit !important}.redux-metabox .form-table th,.redux-metabox .form-table td{margin:0;padding:0}.redux-no-sections .redux-group-tab{display:block !important}.redux-notices{margin-bottom:0;border:0}.wp-color-result{margin:0 6px 0 0 !important}.redux-container .ui-button-text-only .ui-button-text{padding:0}@media(max-width:782px){.redux-container{margin-left:0;margin-right:0;width:100%}.redux-container .redux-main{padding:15px;margin-left:0;border-left:0}.redux-container .redux-sidebar{margin-left:-314px}.redux-container .redux-group-tab{display:block}.redux-container.redux-has-sections .redux-group-tab{display:block !important;margin-top:10px}.redux-container.redux-has-sections .redux-group-tab:first-child{margin-top:0}.redux-main .redux_field_th{width:100% !important;float:none}.redux-main .redux_field{width:100% !important}.redux-main .form-table>tbody>tr>td{padding-top:0 !important;padding-bottom:0 !important}.redux-main .redux-field-container{padding:0 0 20px 0 !important;padding-bottom:10px !important}.redux_field_th{padding-top:0 !important;padding-bottom:10px !important}}@media(max-width:601px){.redux-container.redux-wp-style .redux-main img{max-width:95% !important}}
|
||||
@@ -0,0 +1 @@
|
||||
jQuery(function(r){"use strict";r.reduxUsers=r.reduxUsers||{},r(document).ready(function(){r.reduxUsers.init()}),r.reduxUsers.init=function(){var e=void 0===r(".redux-ajax-security").data("opt-name")?redux.optName:redux;r.reduxUsers.notLoaded=!0,r.redux.initFields(),e.args.ajax_save=0,e.args.disable_save_warn=!0},r.reduxUsers.editCount=r("#the-list tr"),r.reduxUsers.editCheck=function(){var e;return!r("#ajax-response .error").length&&((e=r("#the-list tr").length)>r.reduxUsers.editCount?(window.location.reload(),!1):(setTimeout(r.reduxUsers.editCheck,100),void(r.reduxUsers.editCount=e)))},r("#submit").on("click",function(){window.onbeforeunload=null,r.reduxUsers.editCount=r("#the-list tr").length,r(document).ajaxSuccess(function(){r.reduxUsers.editCheck()})})});
|
||||
@@ -0,0 +1,240 @@
|
||||
.wrap {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.redux-main {
|
||||
min-height: 0 !important;
|
||||
}
|
||||
|
||||
.redux-users.edit-page {
|
||||
.redux-group-tab {
|
||||
margin-bottom: 10px !important;
|
||||
}
|
||||
.redux-main {
|
||||
.redux_field_th {
|
||||
width: 100% !important;
|
||||
float: none;
|
||||
padding-top: 0;
|
||||
}
|
||||
.redux_field {
|
||||
width: 100%;
|
||||
}
|
||||
.redux-field-container {
|
||||
padding: 10px 0 0 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.redux-container {
|
||||
display: block;
|
||||
margin-top: 10px;
|
||||
.redux-section-title {
|
||||
padding-left: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.redux-field-container {
|
||||
padding: 10px 0 0 !important;
|
||||
}
|
||||
|
||||
.redux-section-desc {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.redux_main {
|
||||
input[type=text] {
|
||||
width: 95%;
|
||||
}
|
||||
}
|
||||
.redux-group-tab h3:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
&.redux-has-sections {
|
||||
.redux-group-tab {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
.redux-main {
|
||||
background: #fff;
|
||||
span.description {
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
}
|
||||
.redux-field-container {
|
||||
padding: 10px 0 20px !important;
|
||||
}
|
||||
}
|
||||
&.redux-no-sections {
|
||||
.redux-field-container {
|
||||
padding: 10px 0 20px !important;
|
||||
}
|
||||
.redux-main {
|
||||
padding: 6px 15px 15px 15px !important;
|
||||
margin-left: 0;
|
||||
border-left: 0;
|
||||
.default_br {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.form-table th, .form-table td {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.redux-wp-style {
|
||||
box-shadow: 0 0 !important;
|
||||
border: none;
|
||||
background: none;
|
||||
.redux-field-container {
|
||||
padding: 10px 0 0 !important;
|
||||
}
|
||||
.redux-group-tab h3 {
|
||||
border-bottom-color: #ddd;
|
||||
}
|
||||
.redux-main {
|
||||
box-shadow: none;
|
||||
background: none;
|
||||
margin-left: inherit;
|
||||
padding: inherit;
|
||||
border-left: none !important;
|
||||
min-height: 0 !important;
|
||||
.form-table tr {
|
||||
border-bottom: 0;
|
||||
}
|
||||
.redux-field-container {
|
||||
padding: 5px 0 !important;
|
||||
}
|
||||
|
||||
.redux_field_th {
|
||||
width: 210px;
|
||||
float: left;
|
||||
}
|
||||
.redux_field {
|
||||
width: 70%;
|
||||
}
|
||||
img {
|
||||
max-width: 99% !important;
|
||||
}
|
||||
|
||||
tr {
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
th,
|
||||
td {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
td {
|
||||
//padding-top: 20px !important;
|
||||
padding-top: 10px !important;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.form-table:first-child tr:first-child td {
|
||||
padding-top: 0 !important;
|
||||
}
|
||||
|
||||
.redux-field {
|
||||
margin-bottom: 10px !important;
|
||||
}
|
||||
|
||||
.redux-field:last-child {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.redux-container .redux-group-tab h3 {
|
||||
cursor: text !important;
|
||||
-webkit-user-select: inherit !important;
|
||||
-moz-user-select: inherit !important;
|
||||
user-select: inherit !important;
|
||||
padding-left: 0 !important;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.display-group {
|
||||
display: inherit !important;
|
||||
}
|
||||
|
||||
.redux-metabox .form-table th,
|
||||
.redux-metabox .form-table td {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
/* width: auto;*/
|
||||
}
|
||||
@media (max-width: 601px) {
|
||||
.redux-container.redux-wp-style .redux-main img {
|
||||
max-width: 95% !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 782px) {
|
||||
.redux-container {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
width: 100%;
|
||||
.redux-main {
|
||||
padding: 15px;
|
||||
margin-left: 0;
|
||||
border-left: 0;
|
||||
}
|
||||
.redux-sidebar {
|
||||
margin-left: -314px;
|
||||
}
|
||||
.redux-group-tab {
|
||||
display: block;
|
||||
}
|
||||
&.redux-has-sections .redux-group-tab {
|
||||
display:block !important;
|
||||
margin-top: 10px;
|
||||
&:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.redux-main {
|
||||
.redux_field_th {
|
||||
width: 100% !important;
|
||||
float: none;
|
||||
}
|
||||
.redux_field {
|
||||
width: 100% !important;
|
||||
}
|
||||
.form-table > tbody > tr > td {
|
||||
padding-top: 0 !important;
|
||||
padding-bottom: 0 !important;
|
||||
}
|
||||
.redux-field-container {
|
||||
padding: 0 0 20px 0 !important;
|
||||
padding-bottom: 10px !important;
|
||||
}
|
||||
}
|
||||
.redux_field_th {
|
||||
padding-top: 0 !important;
|
||||
padding-bottom: 10px !important;
|
||||
}
|
||||
}
|
||||
|
||||
.redux-no-sections .redux-group-tab {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.redux-notices {
|
||||
margin-bottom: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.wp-color-result {
|
||||
margin: 0 6px 0 0 !important;
|
||||
}
|
||||
|
||||
.redux-container .ui-button-text-only .ui-button-text {
|
||||
padding: 0;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* Redux User Meta Extension Helpers
|
||||
*
|
||||
* @package Redux
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
// Helper function to bypass WordPress hook priorities. ;).
|
||||
if ( ! function_exists( 'create_term_redux_users' ) ) {
|
||||
|
||||
/**
|
||||
* Create_term_redux_users.
|
||||
*
|
||||
* @param string $profile_id Profile ID.
|
||||
*/
|
||||
function create_term_redux_users( string $profile_id ) {
|
||||
$instances = Redux::all_instances();
|
||||
|
||||
foreach ( $_POST as $key => $value ) { // phpcs:ignore WordPress.Security.NonceVerification
|
||||
if ( is_array( $value ) && isset( $instances[ $key ] ) ) {
|
||||
$instances[ $key ]->extensions['users']->user_meta_save( $profile_id );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
add_action( 'create_term', 'create_term_redux_users', 4 );
|
||||
Reference in New Issue
Block a user