Description
After activating the theme on our WordPress site, which apparently had WP_DEBUG_DISPLAY turned on by our hosting provider, we were presented with the following warning at the top of our site:
_load_textdomain_just_in_time function was called incorrectly (or something similar).
After some troubleshooting in a clean development container, I found the problem in block_pattrern.php. Moving
$this->setup_properties(); // <-- uses __() too early
from the __construct() function to the run() function, fixed the issue.
Hope this helps, and a fix will be available in the next update.
Step-by-step reproduction instructions
- Enable WP_DEBUG_DISPLAY
- Install and activate the [non-profit FSE] theme
The warning displays at the top
Screenshots, screen recording, code snippet or Help Scout ticket
The working code:
public function __construct() {
add_action( 'init', [ $this, 'run' ] );
}
public function run() {
$this->setup_properties(); // <-- now runs on init, safe
$this->register_categories();
$this->register_patterns();
}
Environment info
No response
Is the issue you are reporting a regression
No
Description
After activating the theme on our WordPress site, which apparently had WP_DEBUG_DISPLAY turned on by our hosting provider, we were presented with the following warning at the top of our site:
_load_textdomain_just_in_time function was called incorrectly (or something similar).
After some troubleshooting in a clean development container, I found the problem in block_pattrern.php. Moving
$this->setup_properties(); // <-- uses __() too earlyfrom the __construct() function to the run() function, fixed the issue.
Hope this helps, and a fix will be available in the next update.
Step-by-step reproduction instructions
The warning displays at the top
Screenshots, screen recording, code snippet or Help Scout ticket
The working code:
Environment info
No response
Is the issue you are reporting a regression
No