/**
  * Returns and/or create the single instance of this class.  
  *
  * @return  Charitable_Templates
  * @access  public
  * @since   1.2.0
  */
 public static function get_instance()
 {
     if (is_null(self::$instance)) {
         self::$instance = new Charitable_Templates();
     }
     return self::$instance;
 }
Ejemplo n.º 2
0
 /**
  * Set up the class. 
  *
  * @access 	private
  * @since 	1.0.0
  */
 private function __construct()
 {
     add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'));
     add_filter('post_class', array($this, 'campaign_post_class'));
     /**
      * We are registering this object only for backwards compatibility. It
      * will be removed in or after Charitable 1.3.
      *
      * @deprecated
      */
     charitable()->register_object(Charitable_Session::get_instance());
     charitable()->register_object(Charitable_Templates::get_instance());
     do_action('charitable_public_start', $this);
 }
 /**
  * Set up the class.
  *
  * @access 	private
  * @since 	1.0.0
  */
 private function __construct()
 {
     add_action('after_setup_theme', array($this, 'load_template_files'));
     add_action('wp_enqueue_scripts', array($this, 'setup_scripts'));
     add_action('wp_enqueue_scripts', array($this, 'maybe_enqueue_donation_form_scripts'), 11);
     add_action('charitable_campaign_loop_before', array($this, 'maybe_enqueue_donation_form_scripts'));
     add_filter('post_class', array($this, 'campaign_post_class'));
     add_filter('comments_open', array($this, 'disable_comments_on_application_pages'), 10, 2);
     /**
      * We are registering this object only for backwards compatibility. It
      * will be removed in or after Charitable 1.3.
      *
      * @deprecated
      */
     charitable()->register_object(Charitable_Session::get_instance());
     charitable()->register_object(Charitable_Templates::get_instance());
     do_action('charitable_public_start', $this);
 }
 * @package     Charitable/Functions/Templates
 * @version     1.0.0
 * @author      Eric Daams
 * @copyright   Copyright (c) 2015, Studio 164a
 * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
 */
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
/**
 * Set up custom template locations.
 *
 * @see     Charitable_Templates::template_loader()
 */
add_filter('template_include', array(Charitable_Templates::get_instance(), 'template_loader'), 12);
/**
 * Add custom CSS to the <head>.
 *
 * @see     charitable_template_custom_styles()
 */
add_filter('wp_head', 'charitable_template_custom_styles');
/**
 * Add custom Charitable body classes to certain templates.
 *
 * @see     charitable_add_body_classes()
 */
add_filter('body_class', 'charitable_add_body_classes');
/**
 * Modifying the output of the_content().
 *