TitanFramework::getAllInstances PHP Method

getAllInstances() public static method

Gets all active instances of Titan Framework
Since: 1.9.2
public static getAllInstances ( ) : array
return array An array of TitanFramework objects
    public static function getAllInstances()
    {
        return self::$instances;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Ajax handler for generating CSS based on the existing options with values changed to
  * match the customizer modified values.
  *
  * @since 1.9.2
  *
  * @return void
  */
 public function ajaxGenerateCustomizerCSS()
 {
     // This value is passed back to the live preview ajax handler in $this->livePreviewMainScript()
     $generated = array('css' => '');
     foreach (TitanFramework::getAllInstances() as $framework) {
         // Modify the values of the options for the generation of CSS with the values from the customizer $_POST.
         $namespace = $framework->optionNamespace;
         add_filter("tf_pre_get_value_{$namespace}", array($this, 'useCustomizerModifiedValue'), 10, 3);
         // Generate our new CSS based on the customizer values
         $css = $framework->cssInstance->generateCSS();
         $generated['css'] .= $css;
         /**
          * Allow options to add customizer live preview parameters. The tf_generate_customizer_preview_js hook allows for manipulating these values.
          *
          * @since 1.9.2
          *
          * @see tf_generate_customizer_preview_js
          */
         $generated = apply_filters("tf_generate_customizer_preview_css_{$namespace}", $generated);
     }
     wp_send_json_success($generated);
 }