こんにちは、今日はWordPressでテンプレート関連のフィルターフックについてまとめていきます。
確認環境
WordPress 5.5.1
フィルターフック一覧
| フック名 | 説明 |
| locale_stylesheet_uri | get_locale_stylesheet_uri関数によって返されるロケール固有のスタイルシートURIに適用されます。 |
| stylesheet | get_stylesheet関数によって返されるスタイルシートに適用されます。 |
| stylesheet_directory | get_stylesheet_directory関数によって返されるスタイルシートディレクトリに適用されます。 |
| stylesheet_directory_uri | get_stylesheet_directory_uri関数によって返されるスタイルシートディレクトリURIに適用されます。 |
| stylesheet_uri | get_stylesheet_uri関数によって返されるスタイルシートURIに適用されます。 |
| template | get_template関数によって返されるテンプレートに適用されます。 |
| template_directory | get_template_directory関数によって返されるテンプレートディレクトリに適用されます。 |
| template_directory_uri | get_template_directory_uri関数によって返されるテンプレートディレクトリURIに適用されます。 |
| theme_root | get_theme_root関数によって返されるテーマルートディレクトリ(通常はwp-content / themes)に適用されます。 |
| theme_root_uri | get_theme_root_uri関数によって返されるテーマルートディレクトリURIに適用されます。 |
| 404_template | |
| archive_template | |
| attachment_template | |
| author_template | |
| category_template | |
| comments_popup_template | |
| comments_template | |
| date_template | |
| home_template | |
| page_template | |
| paged_template | |
| search_template | |
| single_template | |
| shortcut_link | |
| template_include | |
| wp_nav_menu_args | |
| wp_nav_menu_items |