• Hello,

    PHP 8.3 is logging errors :

    The bug in woosidebars – class-woo-conditions.php:57:

    public function __construct () {
    $this->meta_box_settings['title'] = __( 'Conditions', 'woosidebars' ); // ❌ Line 57
    // ...
    }

    Problem: The constructor calls __() immediately when the class is instantiated. This happens during plugin loading (before init hook) because Woo_Sidebars->__construct() creates a new Woo_Conditions object.

    Fix: Delay the translation until it’s actually needed:

    public function __construct () {
        /* DDB - 20251212 - WP 6.7+ fix: delay translation */
        // $this->meta_box_settings['title'] = __( 'Conditions', 'woosidebars' );
        $this->meta_box_settings['title'] = 'Conditions'; // Set untranslated
        add_action( 'init', array( $this, 'init_translations' ) );
        // ...
    }
    
    public function init_translations() {
        $this->meta_box_settings['title'] = __( 'Conditions', 'woosidebars' );
    }

You must be logged in to reply to this topic.