rebase on oct-10-2023

This commit is contained in:
Rachit Bhargava
2023-10-10 17:23:21 -04:00
parent d37566ffb6
commit d096058d7d
4789 changed files with 254611 additions and 307223 deletions

View File

@@ -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, '' );