$props ) { $is_footer = isset($props['footer']) ? $props['footer'] : true ; self::register_script( $handle, $props['src'], $props['deps'], $props['version'], $is_footer ); } } /** * Register Styles */ public static function register_styles($register_styles) { foreach ( $register_styles as $handle => $props ) { self::register_style( $handle, $props['src'], $props['deps'], $props['version'], 'all' ); } } /** * Localize Scripts Data * */ public static function localize_script( $handle, $js_var_name, $js_var_data=array() ) { if ( wp_script_is( $handle ) ) { if ( empty($js_var_data) ) { return; } wp_localize_script( $handle, $js_var_name, $js_var_data ); } } /** * Add Inline CSS * */ public static function inline_style( $handle, $css ) { if ( $css != '' ) { wp_add_inline_style( $handle, $css ); } } /** * Add Inline JS * */ public static function inline_script( $handle, $js ) { if ( $js != '' ) { wp_add_inline_script( $handle, $js ); } } /** * get plugin url * */ public static function get_url() { return self::$scripts_url; } /** * get plugin version * */ public static function get_version() { return self::$version; } public static function get_instance() { // create a new object if it doesn't exist. is_null(self::$ins) && self::$ins = new self; return self::$ins; } }