/**
  * Load addons. This is executed before the charitable_start hook 
  * to allow addons to hook into that.
  *
  * @param 	Charitable 		$charitable
  * @return 	void
  * @access 	public
  * @static
  * @since 	1.0.0
  */
 public static function load(Charitable $charitable)
 {
     if ($charitable->started()) {
         return;
     }
     new Charitable_Addons();
 }
 /**
  * Instantiate the class, but only during the start phase.
  *
  * @uses 	charitable_start
  * @param 	Charitable 	$charitable 
  * @return 	void
  * @static 
  * @access 	public
  * @since 	1.0.0
  */
 public static function charitable_start(Charitable $charitable)
 {
     if (!$charitable->is_start()) {
         return;
     }
     $class = get_called_class();
     $charitable->register_object(new $class());
 }
/**
 * This returns the original Charitable object.
 *
 * Use this whenever you want to get an instance of the class. There is no
 * reason to instantiate a new object, though you can do so if you're stubborn :)
 *
 * @return 	Charitable
 * @since 	1.0.0
 */
function charitable()
{
    return Charitable::get_instance();
}
Example #4
0
 /**
  * Run the startup sequence.
  *
  * This is only ever executed once.
  *
  * @return  void
  * @access  public
  * @since   1.0.0
  */
 public function start()
 {
     // If we've already started (i.e. run this function once before), do not pass go.
     if ($this->started()) {
         return;
     }
     // Set static instance
     self::$instance = $this;
     // Factory to create new donation instances
     $this->donation_factory = new Charitable_Donation_Factory();
     $this->maybe_start_ajax();
     $this->attach_hooks_and_filters();
     $this->maybe_start_admin();
     $this->maybe_start_public();
     Charitable_Addons::load($this);
 }
Example #5
0
 /**
  * Run the startup sequence. 
  *
  * This is only ever executed once.  
  * 
  * @return  void
  * @access  public
  * @since   1.0.0
  */
 public function start()
 {
     // If we've already started (i.e. run this function once before), do not pass go.
     if ($this->started()) {
         return;
     }
     // Set static instance
     self::$instance = $this;
     $this->maybe_start_ajax();
     $this->maybe_upgrade();
     $this->attach_hooks_and_filters();
     $this->maybe_start_admin();
     $this->maybe_start_public();
     Charitable_Addons::load($this);
 }