/** * Register the default theme modules. * * @return void * @since 1.1 */ function momtaz_register_theme_modules() { if (!defined('Nmwdhj\\VERSION')) { // Register the 'Momtaz Nmwdhj' module. Momtaz_Modules::register(array('slug' => 'momtaz-nmwdhj', 'name' => 'Momtaz Nmwdhj', 'path' => 'momtaz-nmwdhj/nmwdhj.php', 'settings' => array('auto' => true, 'once' => true))); } if (!function_exists('get_the_image')) { // Register the 'Get The Image' module. Momtaz_Modules::register(array('slug' => 'get-the-image', 'name' => 'Get The Image', 'path' => 'get-the-image/get-the-image.php', 'settings' => array('auto' => true, 'once' => true))); } if (!function_exists('loop_pagination')) { // Register the 'Loop Pagination' module. Momtaz_Modules::register(array('slug' => 'loop-pagination', 'name' => 'Loop Pagination', 'path' => 'loop-pagination/loop-pagination.php', 'settings' => array('auto' => true, 'once' => true))); } }
/** * Load the auto-load modules. * * @since: 1.1 */ private function load_modules() { // Get the auto-load modules. $autoload_modules = Momtaz_Modules::get(array('settings' => array('auto' => true))); Momtaz_Modules::load_modules($autoload_modules); }
/** * Load the module. * * @return boolean * @since 1.1 */ public function load($force = false) { if (!$force && $this->get_settings('once') && $this->is_loaded()) { return true; } if ($path = Momtaz_Modules::locate_module($this->get_path())) { // Load the module main file. momtaz_load_template($path, false); // Set the module loader status. $this->statuses['loaded'] = true; return true; } return false; }