private function register_autoloader(): void { spl_autoload_register(function ($class) { $prefix = 'SmartNews_Aggregator_Pro\\'; $base_dir = plugin_dir_path(__FILE__) . '../'; $len = strlen($prefix); if (strncmp($prefix, $class, $len) !== 0) return; $relative_class = substr($class, $len); // تحويل Namespace إلى مسار مجلدات $parts = explode('\\', $relative_class); $class_name = array_pop($parts); // اسم الكلاس (مثل Cron_Manager) $path = str_replace('\\', '/', implode('/', $parts)); // المسار // محاولة إيجاد الملف بنمطين: (1) الاسم المباشر، (2) مع إضافة class- $file_standard = $base_dir . $path . '/' . $class_name . '.php'; $file_with_prefix = $base_dir . $path . '/class-' . strtolower(str_replace('_', '-', $class_name)) . '.php'; if (file_exists($file_standard)) { require $file_standard; } elseif (file_exists($file_with_prefix)) { require $file_with_prefix; } }); }
Warning: Cannot modify header information - headers already sent by (output started at /home1/yxjtzdte/public_html/wp-content/plugins/smartnews-aggregator-pro/includes/class-plugin-init.php:1) in /home1/yxjtzdte/public_html/wp-includes/sitemaps/class-wp-sitemaps-renderer.php on line 190
https://saudigiga.com/author/admin/