admin管理员组文章数量:1122846
WP Rewrite Rules, Custom Templates, and Full Site Editing Themes Compatibility
I'm developing a WordPress plugin that adds a custom rewrite rule using add_rewrite_rule()
and loads a custom template for that rule using the template_include
hook. The template includes get_header()
at the top and get_footer()
at the bottom, which work as expected with traditional themes.
The Problem
When using Full Site Editing (FSE) themes like "Twenty Twenty-Three", I encounter the following deprecation errors:
Deprecated: File Theme without header.php is deprecated since version 3.0.0 with no alternative available. Please include a header.php template in your theme. in /path/to/wp_installation/wp-includes/functions.php on line 5583
Deprecated: File Theme without footer.php is deprecated since version 3.0.0 with no alternative available. Please include a footer.php template in your theme. in /path/to/wp_installation/wp-includes/functions.php on line 5583
Questions
- How can I load the header and footer blocks in FSE themes?
- Is there a way to check if the active theme is an FSE theme?
Updates
Update 1
Creating a custom page template with get_header()
and get_footer()
functions still raises the same errors.
Update 2
This issue appears to be related to this ticket on WordPress core trac.
Any insights or solutions would be greatly appreciated!
本文标签: plugin developmentCustom WP Rewrite Rules and Templates Incompatible with Full Site Editing Themes
版权声明:本文标题:plugin development - Custom WP Rewrite Rules and Templates Incompatible with Full Site Editing Themes 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736302540a1931571.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论