rebase on oct-10-2023
This commit is contained in:
@@ -152,7 +152,7 @@ function get_archive_template() {
|
||||
|
||||
$templates = array();
|
||||
|
||||
if ( count( $post_types ) == 1 ) {
|
||||
if ( count( $post_types ) === 1 ) {
|
||||
$post_type = reset( $post_types );
|
||||
$templates[] = "archive-{$post_type}.php";
|
||||
}
|
||||
@@ -470,8 +470,10 @@ function get_page_template() {
|
||||
$pagename = get_query_var( 'pagename' );
|
||||
|
||||
if ( ! $pagename && $id ) {
|
||||
// If a static page is set as the front page, $pagename will not be set.
|
||||
// Retrieve it from the queried object.
|
||||
/*
|
||||
* If a static page is set as the front page, $pagename will not be set.
|
||||
* Retrieve it from the queried object.
|
||||
*/
|
||||
$post = get_queried_object();
|
||||
if ( $post ) {
|
||||
$pagename = $post->post_name;
|
||||
@@ -662,7 +664,7 @@ function get_attachment_template() {
|
||||
$templates = array();
|
||||
|
||||
if ( $attachment ) {
|
||||
if ( false !== strpos( $attachment->post_mime_type, '/' ) ) {
|
||||
if ( str_contains( $attachment->post_mime_type, '/' ) ) {
|
||||
list( $type, $subtype ) = explode( '/', $attachment->post_mime_type );
|
||||
} else {
|
||||
list( $type, $subtype ) = array( $attachment->post_mime_type, '' );
|
||||
|
||||
Reference in New Issue
Block a user