/**
  * Includes activated templates' settings.php files.
  * 
  * @remark      This is called from the initial loader class.
  */
 public function loadSettingsOfActiveTemplates()
 {
     if (!is_admin()) {
         return;
     }
     if (!FetchTweets_PluginUtility::isInPluginAdminPage()) {
         return;
     }
     $this->_loadFileOfActiveTemplatesByFileName('settings.php');
 }
예제 #2
0
 /**
  * Loads all necessary plugin components.
  * 
  * @remark      A callback of the 'plugins_loaded' action hook.
  */
 public function _replyToLoadPluginComponents()
 {
     do_action('fetch_tweets_action_before_loading_plugin');
     // 2. Option Object - the instantiation will handle the initial set-up
     FetchTweets_Option::getInstance();
     // 3. Load active templates - this must be done after loading the option class as it stores active templates.
     new FetchTweets_TemplatesLoader();
     // 4. Admin pages
     if ($this->_bIsAdmin) {
         new FetchTweets_AdminPage(FetchTweets_Commons::$sAdminKey, $this->_sFilePath);
         new FetchTweets_AdminPage_Contact('', $this->_sFilePath);
     }
     // 5. Post Type - no need to check is_admin() because posts of custom post type can be accessed from the front-end.
     new FetchTweets_PostType(FetchTweets_Commons::PostTypeSlug, null, $this->_sFilePath);
     // post type slug
     // 6. Meta-boxes
     if ($this->_bIsAdmin) {
         $this->_registerMetaBoxes();
     }
     // 7. Shortcode - enables the shortcode. e.g. [fetch_tweets id="143"]
     new FetchTweets_Shortcode('fetch_tweets');
     // 8. Widgets
     add_action('widgets_init', 'FetchTweets_WidgetByID::registerWidget');
     add_action('widgets_init', 'FetchTweets_WidgetByTag::registerWidget');
     // 9. Events - handles background processes.
     new FetchTweets_Event();
     // 10. MISC
     if (FetchTweets_PluginUtility::isInPluginAdminPage()) {
         $GLOBALS['oFetchTweetsUserAds'] = isset($GLOBALS['oFetchTweetsUserAds']) ? $GLOBALS['oFetchTweetsUserAds'] : new FetchTweets_UserAds();
     }
     // 11. WordPress version backward compatibility.
     $this->_defineConstantesForBackwardCompatibility();
     do_action('fetch_tweets_action_after_loading_plugin');
 }