[wp-trac] [WordPress Trac] #63086: Customizer: notice errror regarding WP_Theme::is_block_theme
WordPress Trac
noreply at wordpress.org
Fri Mar 14 10:26:11 UTC 2025
#63086: Customizer: notice errror regarding WP_Theme::is_block_theme
-------------------------------------------------+-------------------------
Reporter: wildworks | Owner: joemcgill
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 6.8
Component: Customize | Version:
Severity: normal | Resolution:
Keywords: has-testing-info has-patch needs- | Focuses:
unit-tests |
-------------------------------------------------+-------------------------
Comment (by neo2k23):
I had to create a plugin to suppress the messages as this is not workable
while testing the wordpress beta. Not only woocommerce triggers this.
Plugins calling the function wp_get_theme to check the theme information
also trigger the error message for each time it is called.
{{{#!php
<?php
/*
Plugin Name: WP Hide Doing It Wrong Message
Plugin URI: https://www.backups.nl/
Description: WordPress Hide the WordPress doing it wrong message for
loading textdomain and is_block_theme
Version: 1.0
Author: BackuPs
Author URI: https://www.backups.nl/
Email Address : info at backups.nl
License: GPL2
*/
if ( !function_exists( 'theme_hide_doing_it_wrong_notice' ) ) {
function theme_hide_doing_it_wrong_notice( $trigger, $function,
$message, $version ) {
// Update the $trigger variable according to your website
requirements and return this variable. You can modify the $trigger
variable conditionally too if you want.
if( $function == 'WP_Theme::is_block_theme' || $function
== 'load_plugin_textdomain' ) return false;
return $trigger;
}
add_filter( "doing_it_wrong_trigger_error",
"theme_hide_doing_it_wrong_notice", 10, 4 );
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63086#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list