/** * Load and set hooks * * @access public * @static * @return void */ public function load() { foreach (new DirectoryIterator($this->dir) as $file) { $file_name = $file->getFileName(); if (!$file->isDir() && strpos($file->getFileName(), '.') !== 0) { $class = SP_Class_Manager::format_class_name($file->getFileName()); add_action('widgets_init', create_function('', 'register_widget( "' . $class . '" );')); } } }
/** * Load and set hooks * * @access public * @static * @return void */ public function load_hooks() { foreach (new DirectoryIterator($this->hook_dir) as $file) { $file_name = $file->getFileName(); if (!$file->isDir() && strpos($file->getFileName(), '.') !== 0) { $class = SP_Class_Manager::format_class_name($file->getFileName()); if ('SP_Hook' != $class) { self::$hooks[$class] = new $class(); } } } }
/** * Load and set shortcodes * * @access public * @static * @return void */ public function load_shortcodes() { foreach (new DirectoryIterator($this->shortcode_dir) as $file) { $file_name = $file->getFileName(); if (!$file->isDir() && strpos($file->getFileName(), '.') !== 0) { $class = SP_Class_Manager::format_class_name($file->getFileName()); if ('SP_Shortcode' != $class) { self::$shortcodes[$class] = new $class(); } } } // Load the deprecated shortcode $this->load_deprecated_shortcodes(); }