/**
  * Return the singleton instance
  * @since  0.1
  * @return WPSC_Template_Engine
  */
 public static function get_instance()
 {
     if (!self::$instance) {
         self::$instance = new WPSC_Template_Engine();
     }
     return self::$instance;
 }
Example #2
0
/**
 * Enqueue a registered wpsc script (and optionally localize its JS data).
 * If script cannot be enqueued yet, register the queued script for later enqueue.
 *
 * @see WPSC_Template_Engine::register_queued_script()
 * @see wp_enqueue_script()
 * @see wpsc_localize_script()
 *
 * @since 4.0
 *
 * @param string $handle      Name of the registered wpsc script.
 * @param array  $script_data (Optional) data to send to wp_localize_script under the WPSC namespace.
 */
function wpsc_enqueue_script($handle, $script_data = array())
{
    if (!did_action('wpsc_enqueue_scripts')) {
        WPSC_Template_Engine::get_instance()->register_queued_script($handle, $script_data);
    } else {
        _wpsc_enqueue_and_localize_script($handle, $script_data);
    }
}
Example #3
0
function wpsc_locate_view_wrappers($files, $load = false, $require_once = true)
{
    $engine = WPSC_Template_Engine::get_instance();
    return _wpsc_locate_stuff($engine->get_view_wrapper_paths(), $files, $load, $require_once);
}