この記事は最後に更新してから1年以上経過しています。

使っていないか確認しないとね!(フィルター編)

説明

先週末にWordPress 5.2 Beta3(以降5.2Beta3)が公開され、正式リリースまであとわずか。ソースコードの変更点を見ていくと、wp-login.phpの中に非推奨となったフィルターが目に留まった。

フィルター名の変更

5.2Beta3のwp-login.phpでは'login_headertitle'フィルターが非推奨となり、その代わりに'login_headertext'フィルターが追加されている。気になったソースコードを一通り調べてみると、非推奨になっているフィルターがほかにも見つかった。

フィルター名定義非推奨代替フィルター名
auth_{$type}_{$subtype}_meta_{$meta_key}4.6.04.9.8auth_{$type}_meta_{$meta_key}_for_{$subtype}
'htmledit_pre'4.3.0'format_for_editor'
'richedit_pre'4.3.0'format_for_editor'
'blog_details'MU (3.0.0)4.7.0'site_details'
'rest_enabled'4.4.04.7.0'rest_authentication_errors'
'login_headertitle'2.1.05.2.0'login_headertext'

自身が使っているテーマや自作したプラグインなどでこれらのフィルターを使っている場合は、適当な段階で代替フィルターに書き換えるべきだろう。


最終更新 : 2019年04月24日 21:54

お勧め

wp_print_inline_script_tag(2021年4月19日 更新)

void wp_print_inline_script_tag( string $javascript [ , array $attributes = array() ] )
インラインJavaScriptを含むscript要素を出力する。

register_rest_route(2022年8月17日 更新)

bool register_rest_route( string $namespace, string $route [ , array $args = array() [ , bool $override = false ] ] )
REST APIのルートを登録する。

wp_determine_option_autoload_value(2024年7月22日 更新)

string wp_determine_option_autoload_value( string $option, mixed $value, mixed $serialized_value, boo l |string $autoload )
自動ロードのトリガー値を取得する。

single_tag_title(2018年5月27日 更新)

string single_tag_title( [ string $prefix = '' [ , bool $display = true ] ] )
投稿タグアーカイブページの投稿タグ名を取得し、パラメータ$displayがtrueならば表示する。$displayがfalseの場合は、文字列として返す。

home_url(2023年3月31日 更新)

string home_url( [ string $path = '' [ , string $scheme = null ] ] )
現在のブログ(サイト)のホームURLを取得する。ホームURLは、管理者ページの「設定」-「一般」の「サイトのアドレス(URL)」のこと。