diff --git a/content-warning-v2.php b/content-warning-v2.php index aca9151..b1b20be 100644 --- a/content-warning-v2.php +++ b/content-warning-v2.php @@ -289,14 +289,13 @@ class ContentWarning_v2 { * @return null */ public function register_frontend_data() { - $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; // Jquery Cookie - wp_register_script( 'jquery_cookie', plugins_url( "js/jquery_cookie{$min}.js", dirname( __FILE__ ) ), array( 'jquery' ), '1.4.1', true ); + wp_register_script( 'jquery_cookie', $this->url( "js/jquery_cookie{$this->min}.js" ), array( 'jquery' ), '1.4.1', true ); // Main data - wp_register_script( 'cwv3_js', plugins_url( "js/cwv3{$min}.js", dirname( __FILE__ ) ), array( 'jquery_cookie' ), '3.6.0', true ); - wp_register_style( 'cwv3_css', plugins_url( "css/cwv3{$min}.css", dirname( __FILE__ ) ), '', '1.0' ); + wp_register_script( 'cwv3_js', $this->url( "js/cwv3{$this->min}.js" ), array( 'jquery_cookie' ), '3.6.0', true ); + wp_register_style( 'cwv3_css', $this->url( "css/cwv3{$this->min}.css" ), '', '1.0' ); } /** diff --git a/includes/api.php b/includes/api.php index 9705af5..9f72258 100644 --- a/includes/api.php +++ b/includes/api.php @@ -22,7 +22,9 @@ function cwv3_get_css() { $image = get_option( 'cwv3_bg_image', '' ); $color = get_option( 'cwv3_bg_color', '' ); $custom_css = get_option( 'cwv3_css', '' ); - $opacity = get_option( 'cwv3_bg_opacity', '' ); + $opacity = get_option( 'cwv3_bg_opacity', '1' ); + + error_log( print_r( $opacity, 1 ) ); $bg_image_css = ! empty( $image ) ? 'background: url( '. esc_url( $image ) . ' ) no-repeat top center;' : ''; $bg_color_css = ! empty( $color ) ? 'background-color: ' . $color . ';' : ''; @@ -33,11 +35,9 @@ function cwv3_get_css() {