WordPress 6.8.0でFunction wp_is_block_theme was called incorrectly.が発生

TOP Forums バグ報告と提案(Requests and Feedback) WordPress 6.8.0でFunction wp_is_block_theme was called incorrectly.が発生

WordPress 6.8.0でFunction wp_is_block_theme was called incorrectly.が発生

Viewing 0 reply threads
  • Author
    Posts
    • #1535
      Murodon
      Participant
        
        Type: wp
        KUSANAGI Version 9.6.9-1.el9
        conoha
        CentOS Stream 9
        
        *** (active) nginx : nginx125 ***
        * nginx.service - The NGINX HTTP and reverse proxy server
             Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; preset: disabled)
             Active: active (running) since Sun 2025-04-20 03:12:52 JST; 8h ago
        
        *** (inactive) httpd : httpd24 ***
        * httpd.service - The Apache HTTP Server
             Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; preset: disabled)
             Active: inactive (dead)
        
        *** (active) php : php82 ***
        * php-fpm.service - The PHP FastCGI Process Manager
             Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; enabled; preset: disabled)
             Active: active (running) since Sun 2025-04-20 00:53:11 JST; 10h ago
        
        *** (active) mariadb : mariadb10.6 ***
        * mariadb.service - MariaDB 10.6.21 database server
             Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; preset: disabled)
             Active: active (running) since Fri 2025-04-04 14:22:58 JST; 2 weeks 1 day ago
        
        *** (inactive) psql :  ***
        
        *** (inactive) pgpool-II :  ***
        
        *** python ***
        Python 3.9.22
        
        *** Cache status ***
        bcache on
        fcache off
        
        *** WAF ***
        off
        
        *** SELinux ***
        off
        
        status completed.
        

        Wordpress6.8.0へアップグレード後、フロントページを見ると

        Notice: Function wp_is_block_theme was called incorrectly. This function should not be called before the theme directory is registered. Please see Debugging in WordPress for more information. (This message was added in version 6.8.0.) in /home/kusanagi/profile_folder/DocumentRoot/wp-includes/functions.php on line 6121
        

        とNoticeが発生します。

        wp_is_block_themeはテーマ内では使用していなかったので、使用箇所を調べたところ、

        mu-plugins>kusanagi-core>modules>theme-accelerator>theme-acccelerator-logic.php

        
        	public static function is_block_templates() {
        		if ( ! function_exists( 'wp_is_block_theme' ) || ! function_exists( 'wp_theme_has_theme_json' ) ) {
        			return false;
        		}
        		if ( wp_is_block_theme() || wp_theme_has_theme_json() ) {
        			return true;
        		}
        
        		return false;
        	}
        

        この箇所で使用しているのみでした。

        試しにKusanagiプラグインにてテーマアクセラレーターを無効にしたところ、Noticeが発生しなくなりました。
        プラグインはアップデート済みです。

        ChatGPTではafter_setup_theme のフックを使うと推奨しているようです。

        以上ご報告まで。

    Viewing 0 reply threads
    • You must be logged in to reply to this topic.

    Next article

    フォーラムについて