🏨 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>
92 lines
2.1 KiB
PHP
92 lines
2.1 KiB
PHP
<?php
|
|
/**
|
|
* Register an autoloader for custom mu-plugins.
|
|
*
|
|
* @package redux-framework
|
|
*/
|
|
|
|
/**
|
|
* Class Autoloader
|
|
*
|
|
* @package altis/core
|
|
*/
|
|
class Redux_Autoloader {
|
|
const NS_SEPARATOR = '\\';
|
|
|
|
/**
|
|
* Prefix to validate against.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $prefix;
|
|
|
|
/**
|
|
* String length of the prefix.
|
|
*
|
|
* @var int
|
|
*/
|
|
protected $prefix_length;
|
|
|
|
/**
|
|
* Path to validate.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $path;
|
|
|
|
/**
|
|
* Autoloader constructor.
|
|
*
|
|
* @param string $prefix Prefix to validate against.
|
|
* @param string $path Path to validate.
|
|
*/
|
|
public function __construct( string $prefix, string $path ) {
|
|
$this->prefix = $prefix;
|
|
$this->prefix_length = strlen( $prefix );
|
|
$this->path = trailingslashit( $path );
|
|
}
|
|
|
|
/**
|
|
* Load a class file if it matches our criteria.
|
|
*
|
|
* @param string $classname Class to test and/or load.
|
|
*/
|
|
public function load( string $classname ) {
|
|
if ( strpos( $classname, 'Redux' ) === false ) {
|
|
return;
|
|
}
|
|
|
|
// Strip prefix from the start (ala PSR-4).
|
|
$classname = substr( $classname, $this->prefix_length + 1 );
|
|
if ( function_exists( 'mb_strtolower' ) && function_exists( 'mb_detect_encoding' ) ) {
|
|
$classname = mb_strtolower( $classname, mb_detect_encoding( $classname ) );
|
|
} else {
|
|
$classname = strtolower( $classname );
|
|
}
|
|
|
|
$file = '';
|
|
// Split on namespace separator.
|
|
$last_ns_pos = strripos( $classname, self::NS_SEPARATOR );
|
|
if ( false !== $last_ns_pos ) {
|
|
$namespace = substr( $classname, 0, $last_ns_pos );
|
|
$classname = substr( $classname, $last_ns_pos + 1 );
|
|
$file = str_replace( self::NS_SEPARATOR, DIRECTORY_SEPARATOR, $namespace ) . DIRECTORY_SEPARATOR;
|
|
}
|
|
$file_prefix = $file;
|
|
$file = $file_prefix . 'class-' . str_replace( '_', '-', $classname ) . '.php';
|
|
|
|
$path = $this->path . $file;
|
|
|
|
if ( file_exists( $path ) ) {
|
|
require_once $path;
|
|
} else {
|
|
$file = $file_prefix . 'class-redux-' . str_replace( '_', '-', $classname ) . '.php';
|
|
$path = $this->path . $file;
|
|
|
|
if ( file_exists( $path ) ) {
|
|
require_once $path;
|
|
}
|
|
}
|
|
}
|
|
}
|