args['dev_mode'] ) {
$msg = sprintf( __( 'If you are developing offline, please download and install the Redux Vendor Support plugin/extension to bypass the our CDN and avoid this warning', 'virtue' ), 'https://github.com/reduxframework/redux-vendor-support' );
}
self::$_parent->admin_notices[] = array(
'type' => 'error',
'msg' => '' . __( 'Redux Framework Warning', 'virtue' ) . '
' . sprintf( __( '%s CDN unavailable. Some controls may not render properly.', 'virtue' ), $handle ) . ' ' . $msg,
'id' => $handle . $tran_key,
'dismiss' => false,
);
}
}
} else {
set_transient( $handle . $tran_key, true, MINUTE_IN_SECONDS * self::$_parent->args['cdn_check_time'] );
if ( $register ) {
self::_register( $handle, $src_cdn, $deps, $ver, $footer_or_media, $is_script );
} else {
self::_enqueue( $handle, $src_cdn, $deps, $ver, $footer_or_media, $is_script );
}
}
}
}
private static function _vendor_plugin( $register = true, $handle, $src_cdn, $deps, $ver, $footer_or_media, $is_script = true ) {
if ( class_exists( 'Redux_VendorURL' ) ) {
$src = Redux_VendorURL::get_url( $handle );
if ( $register ) {
self::_register( $handle, $src, $deps, $ver, $footer_or_media, $is_script );
} else {
self::_enqueue( $handle, $src, $deps, $ver, $footer_or_media, $is_script );
}
} else {
if ( ! self::$_set ) {
self::$_parent->admin_notices[] = array(
'type' => 'error',
'msg' => sprintf( __( 'The Vendor Support plugin (or extension) is either not installed or not activated and thus, some controls may not render properly. Please ensure that it is installed and activated', 'virtue' ), 'https://github.com/reduxframework/redux-vendor-support', admin_url( 'plugins.php' ) ),
'id' => $handle . '23',
'dismiss' => false,
);
self::$_set = true;
}
}
}
public static function register_style( $handle, $src_cdn = false, $deps = array(), $ver = false, $media = 'all' ) {
if ( self::$_parent->args['use_cdn'] ) {
self::_cdn( true, $handle, $src_cdn, $deps, $ver, $media, $is_script = false );
} else {
self::_vendor_plugin( true, $handle, $src_cdn, $deps, $ver, $media, $is_script = false );
}
}
public static function register_script( $handle, $src_cdn = false, $deps = array(), $ver = false, $in_footer = false ) {
if ( self::$_parent->args['use_cdn'] ) {
self::_cdn( true, $handle, $src_cdn, $deps, $ver, $in_footer, $is_script = true );
} else {
self::_vendor_plugin( true, $handle, $src_cdn, $deps, $ver, $in_footer, $is_script = true );
}
}
public static function enqueue_style( $handle, $src_cdn = false, $deps = array(), $ver = false, $media = 'all' ) {
if ( self::$_parent->args['use_cdn'] ) {
self::_cdn( false, $handle, $src_cdn, $deps, $ver, $media, $is_script = false );
} else {
self::_vendor_plugin( false, $handle, $src_cdn, $deps, $ver, $media, $is_script = false );
}
}
public static function enqueue_script( $handle, $src_cdn = false, $deps = array(), $ver = false, $in_footer = false ) {
if ( self::$_parent->args['use_cdn'] ) {
self::_cdn( false, $handle, $src_cdn, $deps, $ver, $in_footer, $is_script = true );
} else {
self::_vendor_plugin( false, $handle, $src_cdn, $deps, $ver, $in_footer, $is_script = true );
}
}
}
}