Add sanity checks to `get_*_template()` functions to ensure that the return value of `get_queried_object()` is compatible with the assumed context.

Fixes #25291.
See #25282.



git-svn-id: https://develop.svn.wordpress.org/trunk@25386 602fd350-edb4-49c9-b593-d223f7449a82
Suppress the `_doing_it_wrong` notices when calling `add_theme_support( 'html5' )` in `tests/theme/support.php`

See #25282.



git-svn-id: https://develop.svn.wordpress.org/trunk@25387 602fd350-edb4-49c9-b593-d223f7449a82