if ( 'wp_template' ===
$post->post_type &&
empty( $template->description
) && ( empty( $template->title
) ||
$template->title ===
$template->slug
) ) { $matches = array
();
// Check for a block template for a single author, page, post, tag, category, custom post type, or custom taxonomy.
if ( preg_match( '/(author|page|single|tag|category|taxonomy)-(.+)/',
$template->slug,
$matches ) ) { $type =
$matches[1
];
$slug_remaining =
$matches[2
];
switch ( $type ) { case 'author':
$nice_name =
$slug_remaining;
$users =
get_users( array
( 'capability' => 'edit_posts',
'search' =>
$nice_name,
'search_columns' => array
( 'user_nicename'
),
'fields' => 'display_name',
) );
if ( empty( $users ) ) { $template->title =
sprintf( /* translators: Custom template title in the Site Editor, referencing a deleted author. %s: Author nicename. */