Example #1
0
 /**
  * Bootstraps the application by assigning the right functions to
  * the right action hooks.
  *
  * @since 1.0.0
  */
 static function bootStrap()
 {
     self::autoInclude();
     // Initialize localization on init
     add_action('init', array(__CLASS__, 'localize'));
     // Enqueue hooks
     add_action('wp_enqueue_scripts', array(__CLASS__, 'enqueueFrontendScripts'));
     add_action('admin_enqueue_scripts', array(__CLASS__, 'enqueueBackendScripts'));
     // Ajax requests
     SlideshowPluginAJAX::init();
     // Register slideshow post type
     SlideshowPluginPostType::init();
     // Add general settings page
     SlideshowPluginGeneralSettings::init();
     // Initialize stylesheet builder
     SlideshowPluginSlideshowStylesheet::init();
     // Deploy slideshow on do_action('slideshow_deploy'); hook.
     add_action('slideshow_deploy', array('SlideshowPlugin', 'deploy'));
     // Initialize shortcode
     SlideshowPluginShortcode::init();
     // Register widget
     add_action('widgets_init', array('SlideshowPluginWidget', 'registerWidget'));
     // Initialize plugin updater
     SlideshowPluginInstaller::init();
 }
 /**
  * Bootstraps the application by assigning the right functions to
  * the right action hooks.
  *
  * @since 1.0.0
  */
 static function bootStrap()
 {
     self::autoInclude();
     // Initialize localization on init
     add_action('init', array(__CLASS__, 'localize'));
     // For ajax requests
     SlideshowPluginAjax::init();
     // Register slideshow post type
     SlideshowPluginPostType::init();
     // Add general settings page
     SlideshowPluginGeneralSettings::init();
     // Deploy slideshow on do_action('slideshow_deploy'); hook.
     add_action('slideshow_deploy', array('SlideshowPlugin', 'deploy'));
     // Initialize shortcode
     SlideshowPluginShortcode::init();
     // Register widget
     add_action('widgets_init', array('SlideshowPluginWidget', 'registerWidget'));
     // Initialize plugin updater
     SlideshowPluginInstaller::init();
 }
 /**
  * Function insertSlideshow uses the prepare method of class SlideshowPlugin
  * to insert the code for the slideshow on the location a bookmark was found.
  *
  * @since 2.1.8
  * @param String $content
  * @return String $content
  */
 static function insertSlideshow($content)
 {
     // Loop through post ids
     if (is_array(self::$postIds) && count(self::$postIds) > 0) {
         foreach (self::$postIds as $postId) {
             $updatedContent = preg_replace("/" . self::$bookmark . "/", SlideshowPlugin::prepare($postId), $content, 1);
             if (is_string($updatedContent)) {
                 $content = $updatedContent;
             }
         }
     }
     // Reset postIds, so a shortcode in a next post can be used
     self::$postIds = array();
     return $content;
 }