[wp-trac] [WordPress Trac] #62755: Allow template duplication + concept of active templates
WordPress Trac
noreply at wordpress.org
Wed Oct 22 23:41:43 UTC 2025
#62755: Allow template duplication + concept of active templates
-----------------------------+-----------------------
Reporter: ellatrix | Owner: ellatrix
Type: enhancement | Status: reopened
Priority: normal | Milestone: 6.9
Component: Editor | Version: trunk
Severity: normal | Resolution:
Keywords: gutenberg-merge | Focuses:
-----------------------------+-----------------------
Comment (by dd32):
@ellatrix Yup, that's exactly it.
`get_queried_object()` is IMHO very.. annoying :) When you start to mix
query types (Author/post/archive/taxonomy/taxonomy2/etc) it can return
something unexpected.
> Eg: https://wordpress.org/download/?author=1
In this case, `get_queried_object()` is the Downloads page WP_Post, and
specific template is `page-download`
Changing it to `$specific_template = $object && ! is_404() ?
get_page_template_slug( $object ) : null;` does work, but I feel that
`is_404()` might also be truthful for intentionally empty archives.
It might be more unexpected that `/page/?author=x` even causes a 404, and
that `?author` should be ignored on a singular query like this.
This is a much larger issue with Template selection and WP_Query
generation than this ticket :) I think this should just try to avoid
ending up generating a PHP warning..
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62755#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list