子テーマおよびプラグインのPHP8.1対応について

公開日:2023(令和5)年10月15日/最終更新日:

WordPressに関する情報の画像

【景品表示法に基づく表記】ページ内のコンテンツには、商品プロモーションが含まれています



当サイトで配布している以下の子テーマ、プラグインについてPHP8.1でWarningが出ることへの対応方法です。

対応が必要なのは以下の子テーマ・プラグインです。

  • Twenty Twenty-Twoの子テーマ
  • Twenty Twenty-Threeの子テーマ
  • HA Alt Childthemeプラグイン

各子テーマ・プラグインとも1か所から数か所の変更で対応できますので、手動で更新を行ってください。

各配布ページでは対応を行った最新版をダウンロードできるようにしていますが、既にお使いの場合は、子テーマ・プラグインとも、そのまま最新版へ更新してしまうとカスタマイズした内容がすべて消失しますので、必ず手動で修正を行うようにしてください

Twenty Twenty-Twoの子テーマ

既にTT2の子テーマをお使いの方は、そのまま最新版へ更新すると、カスタマイズした内容が消失しますので、手動で以下の部分を変更ください。

「include-child」→「functions.php」の26行目付近にある以下の記述

function tt2_child_enqueue_admin_styles() {

を以下のように変更してください(赤字部分)

function tt2_child_enqueue_admin_styles($hook='null') {
QA Analytics QA Analytics

Twenty Twenty-Threeの子テーマ

既にTT3の子テーマをお使いの方は、そのまま最新版へ更新すると、カスタマイズした内容が消失しますので、手動で以下の部分を変更ください。

「include-child」→「functions.php」の26行目付近にある以下の記述

function tt3_child_enqueue_admin_styles() {

を以下のように変更してください(赤字部分)

function tt3_child_enqueue_admin_styles($hook='null') {

HA Alt Childthemeプラグイン

既にプラグインをお使いの方は、そのまま最新版へ更新すると、カスタマイズした内容が消失しますので、手動で以下の部分を変更ください。

「ha-alt-chidtheme.php」の67行目付近にある以下の記述

function haac_enqueue_admin_custom_style(){

を以下のように変更してください(赤字部分)

function haac_enqueue_admin_custom_style($hook=''){

HA TT3 Theme Json Changerプラグイン

既にプラグインをお使いの方は、そのまま最新版へ更新すると、カスタマイズした内容が消失しますので、手動で以下の部分を変更ください。

1.「custom」→「change-setting.php」の6行目付近にある以下の記述

function hatt3tjc_change_theme_json_setting( $theme_json ) {

を以下のように変更してください(赤字部分)

function hatt3tjc_change_theme_json_setting( $theme_json , $schema ='' ) {

2.「custom」→「change-style.php」の6行目付近にある以下の記述

function hatt3tjc_change_theme_json_style( $theme_json  ) {

を以下のように変更してください(赤字部分)

function hatt3tjc_change_theme_json_style( $theme_json , $schema ='' ) {

3.「custom」→「change-template.php」の6行目付近にある以下の記述

function hatt3tjc_change_theme_json_template( $theme_json ) {

を以下のように変更してください(赤字部分)

function hatt3tjc_change_theme_json_template( $theme_json , $schema ='' ) {

4.「custom」→「change-templateparts.php」の6行目付近にある以下の記述

function hatt3tjc_change_theme_json_templateparts( $theme_json ) {

を以下のように変更してください(赤字部分)

function hatt3tjc_change_theme_json_templateparts( $theme_json , $schema ='' ) {

HA TT2 Theme Json Changerプラグイン

既にプラグインをお使いの方は、そのまま最新版へ更新すると、カスタマイズした内容が消失しますので、手動で以下の部分を変更ください。

1.「custom」→「change-setting.php」の6行目付近にある以下の記述

function hatt2tjc_change_theme_json_setting( $theme_json ) {

を以下のように変更してください(赤字部分)

function hatt2tjc_change_theme_json_setting( $theme_json , $schema ='' ) {

2.「custom」→「change-style.php」の6行目付近にある以下の記述

function hatt2tjc_change_theme_json_style( $theme_json  ) {

を以下のように変更してください(赤字部分)

function hatt2tjc_change_theme_json_style( $theme_json , $schema ='' ) {

3.「custom」→「change-template.php」の6行目付近にある以下の記述

function hatt2tjc_change_theme_json_template( $theme_json ) {

を以下のように変更してください(赤字部分)

function hatt2tjc_change_theme_json_template( $theme_json , $schema ='' ) {

4.「custom」→「change-templateparts.php」の6行目付近にある以下の記述

function hatt2tjc_change_theme_json_templateparts( $theme_json ) {

を以下のように変更してください(赤字部分)

function hatt2tjc_change_theme_json_templateparts( $theme_json , $schema ='' ) {



Lolipop ServerMoshimo Ad x-serverMoshimo Ad