# Get Plugin functions.php $_plugin_functions = glob('_plugins/**/functions.php'); # Include Plugin functions.php if (is_array($_plugin_functions)) { $_includes = array_merge($_includes, $_plugin_functions); } # Include after Plugin functions are loaded $_includes[] = '_includes/core/variables.php'; # Get available plugins $_plugin_files = glob('_plugins/**/plugin.php'); # Include plugins if (is_array($_plugin_files)) { $_includes = array_merge($_includes, $_plugin_files); } /** * Load required files */ foreach ($_includes as $file) { /** * Verify that file exists and * is readable. */ if (!file_exists($file) && !is_readable($file)) { throw new Exception('Required file: ' . $file . ' either does not exist or is not readable.'); } require_once $file; } # Trigger: after_includes if (extras_enabled()) { do_trigger('after_includes'); }
{ # Get Variables Object global $_variables; # Get Variable if (!is_null($name)) { return $_variables->get($name); } # Get All Variables return $_variables->get(); } /** * Get Variables * * @since 1.0.0 */ function vars() { return get(); } # Debug helpers set('dev', array('localhost' => is_localhost())); # Page variables set('page', array('is_home' => is_home(), 'path' => $_path, 'slug' => get_page()), true); # User variables set('user', array('is_loggedin' => is_loggedin())); # Various useful variables set('this_year', this_year()); # Trigger: variables_init if (extras_enabled()) { do_trigger('variables_init'); }
/** * Get Partial * * @param $part: (string) name of partial */ public function get_partial($part) { # Get Partial $partial = $this->load('partials/' . $part); # Return false if not found if ($this->not_found()) { return false; } # Trigger: before_include_$part if (extras_enabled()) { do_trigger('before_include_' . $part); } include $this->dir . '/' . $partial; # Trigger: after_include_$part if (extras_enabled()) { do_trigger('after_include_' . $part); } }