/** * Returns the path of the specified template. * * @since Unknown * @since 2.3.9 Changed it to use the relative path to WordPress installed directory. * @return The template path; false if not exist. */ protected function _getTemplatePathBySlug($sTemplateSlug) { $_oTemplate = new FetchTweets_Template($sTemplateSlug); // passing none to the constructor creates default template object. return $_oTemplate->getPathByFileName('template.php'); }
/** * Loads the file of active template of the given file name. * * @since 2.3.9 * @param string $sFileName The file base name with file extension to load. * @param string $sMethod The method to load. Either 'include' or 'enqueue_style' is accepted. Use 'enqueue_style' for styles. */ private function _loadFileOfActiveTemplatesByFileName($sFileName = 'functions.php', $sMethod = 'include') { $_oOption = FetchTweets_Option::getInstance(); foreach ($_oOption->getActiveTemplates() as $_aTemplate) { $_oTemplate = new FetchTweets_Template($_aTemplate['sSlug']); $_sFilePath = $_oTemplate->getPathByFileName($sFileName); if (!$_sFilePath) { continue; } if (in_array($_sFilePath, self::$_aLoaded)) { continue; } self::$_aLoaded[$_sFilePath] = $_sFilePath; switch ($sMethod) { default: case 'include': include $_sFilePath; break; case 'enqueue_style': wp_register_style("fetch-tweets-" . md5($_aTemplate['sDirPath']), FetchTweets_WPUtilities::getSRCFromPath($_sFilePath)); wp_enqueue_style("fetch-tweets-" . md5($_aTemplate['sDirPath'])); break; } } }