first commit all files

This commit is contained in:
dwindown
2026-01-28 00:26:00 +07:00
parent 65dd207a74
commit 97426d5ab1
72 changed files with 91484 additions and 0 deletions

View File

@@ -0,0 +1,74 @@
<?php
/**
* Autoloader for WP Agentic Writer classes.
*
* @package WP_Agentic_Writer
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Class WP_Agentic_Writer_Autoloader
*
* @since 0.1.0
*/
class WP_Agentic_Writer_Autoloader {
/**
* Singleton instance.
*
* @var WP_Agentic_Writer_Autoloader
*/
private static $instance = null;
/**
* Get singleton instance.
*
* @since 0.1.0
* @return WP_Agentic_Writer_Autoloader
*/
public static function get_instance() {
if ( null === self::$instance ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Constructor.
*
* @since 0.1.0
*/
private function __construct() {
spl_autoload_register( array( $this, 'autoload' ) );
}
/**
* Autoload classes.
*
* @since 0.1.0
* @param string $class Class name.
*/
public function autoload( $class ) {
// Check if class is in our namespace.
if ( strpos( $class, 'WP_Agentic_Writer_' ) !== 0 ) {
return;
}
// Remove namespace prefix.
$class_name = str_replace( 'WP_Agentic_Writer_', '', $class );
$class_name = strtolower( str_replace( '_', '-', $class_name ) );
// Build file path.
$file_path = WP_AGENTIC_WRITER_DIR . 'includes/class-' . $class_name . '.php';
// Include file if exists.
if ( file_exists( $file_path ) ) {
require_once $file_path;
}
}
}
WP_Agentic_Writer_Autoloader::get_instance();