wpseek.com
A WordPress-centric search engine for devs and theme authors



_add_template_loader_filters › WordPress Function

Since5.9.0
Deprecatedn/a
_add_template_loader_filters ( No parameters )
Access:
  • private
Defined at:
Codex:

Adds necessary hooks to resolve '_wp-find-template' requests.



Source

function _add_template_loader_filters() {
	if ( isset( $_GET['_wp-find-template'] ) && current_theme_supports( 'block-templates' ) ) {
		add_action( 'pre_get_posts', '_resolve_template_for_new_post' );
	}
}