サーバー:さくらのレンタルサーバー
PHP:7.4.33
WordPress:6.7.1
elementor: 3.23.4
elementorで500エラー更新不可に。
メモリの問題で対処しても改善されず。
おそらくphp.iniを書き換えた時点でWPに警告が表示されはじめた。
Warning: call\_user\_func\_array() expects parameter 1 to be a valid callback,
function 'twpp\_enqueue\_styles' not found or invalid function name in
/home/example/www/recruit/wp-includes/class-wp-hook.php on line 324
これは初めて見たので。例のあいつ(Chatgpt)に聞いてみたら、テーマのfunctions.phpに以下書き込んでみろと。
if (\!function\_exists('twpp\_enqueue\_styles')) {
function twpp\_enqueue\_styles() {
wp\_enqueue\_style('theme-style', get\_template\_directory\_uri() . '/style.css');
}
}
add\_action('wp\_enqueue\_scripts', 'twpp\_enqueue\_styles');
これで警告も消えた上に、elementorの500エラーも消えて更新可能に。