-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Site Editor]: Update single default template copy
- Loading branch information
1 parent
5b32b22
commit a9a59b9
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
/** | ||
* Temporary compatibility shims for features present in Gutenberg. | ||
* This file should be removed when WordPress 6.1.0 becomes the lowest | ||
* supported version by this plugin. | ||
* | ||
* @package gutenberg | ||
*/ | ||
|
||
/** | ||
* Updates the list of default template types, containing their | ||
* localized titles and descriptions. | ||
* | ||
* We will only need to update `get_default_block_template_types` function. | ||
* | ||
* @param array $default_template_types The default template types. | ||
* | ||
* @return array The default template types. | ||
*/ | ||
function gutenberg_get_default_block_template_types( $default_template_types ) { | ||
if ( isset( $default_template_types['single'] ) ) { | ||
$default_template_types['single'] = array( | ||
'title' => _x( 'Single', 'Template name', 'gutenberg' ), | ||
'description' => __( 'The default template for displaying any single post or attachment.', 'gutenberg' ), | ||
); | ||
} | ||
return $default_template_types; | ||
} | ||
add_filter( 'default_template_types', 'gutenberg_get_default_block_template_types', 10, 2 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters