• Hallo,

    I”m using WordPress 5.8.2 and Php 8.03:

    i got following warning :

    Warning: Trying to access array offset on value of type bool in C:\xampp\htdocs\wordpress\wp-content\plugins\organic-customizer-widgets\public\class-organic-widgets-public.php on line 68

    line 68 : if ( $organic_widgets_settings['additional_stylesheets'] ) {

    from

    the code is:

    	public function enqueue_styles() {
    
    		wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/organic-widgets-public.css', array(), $this->version, 'all' );
    
    		$organic_widgets_settings = get_option( 'organic_widgets_settings' );
    
    		if ( $organic_widgets_settings['additional_stylesheets'] ) {
    
    			switch ( $organic_widgets_settings['additional_stylesheets'] ) {
    				case 2:
    					wp_enqueue_style( $this->plugin_name . '_additional_' . $organic_widgets_settings['additional_stylesheets'], plugin_dir_url( __FILE__ ) . 'css/organic-widgets-public-additional-2.css', array(), $this->version, 'all' );
    					break;
    				case 3:
    					wp_enqueue_style( $this->plugin_name . '_additional_' . $organic_widgets_settings['additional_stylesheets'], plugin_dir_url( __FILE__ ) . 'css/organic-widgets-public-additional-3.css', array(), $this->version, 'all' );
    					break;
    			}
    		}
    
    	}

    Can you help me?
    thx

    • This topic was modified 2 years, 11 months ago by jpmoll.
  • The topic ‘Warning: Trying to access array offset on value of type bool’ is closed to new replies.