From b06588e805acbe6ba92124e495055781eb21a7ce Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Mon, 24 Feb 2025 06:04:32 +0100 Subject: [PATCH] Post formats: Make title and description human readable (#69275) * Post formats: Make title and description human readable Co-authored-by: carolinan Co-authored-by: t-hamano Co-authored-by: Mamaduka --- .../wordpress-6.8/block-template-utils.php | 29 +++++++++++++++++++ lib/load.php | 1 + 2 files changed, 30 insertions(+) create mode 100644 lib/compat/wordpress-6.8/block-template-utils.php diff --git a/lib/compat/wordpress-6.8/block-template-utils.php b/lib/compat/wordpress-6.8/block-template-utils.php new file mode 100644 index 0000000000000..6e792f5be886e --- /dev/null +++ b/lib/compat/wordpress-6.8/block-template-utils.php @@ -0,0 +1,29 @@ + $post_format_name ) { + $default_template_types[ 'taxonomy-post_format-post-format-' . $post_format_slug ] = array( + 'title' => sprintf( + /* translators: %s: Post format name. */ + _x( 'Post Format: %s', 'Template name' ), + $post_format_name + ), + 'description' => sprintf( + /* translators: %s: Post format name. */ + __( 'Displays the %s post format archive.' ), + $post_format_name + ), + ); + } + return $default_template_types; +} + +add_filter( 'default_template_types', 'gutenberg_post_format_template_title_description', 10, 1 ); diff --git a/lib/load.php b/lib/load.php index 789c9f9980e9a..769066111fb95 100644 --- a/lib/load.php +++ b/lib/load.php @@ -104,6 +104,7 @@ function gutenberg_is_experiment_enabled( $name ) { require __DIR__ . '/compat/wordpress-6.8/post.php'; require __DIR__ . '/compat/wordpress-6.8/site-editor.php'; require __DIR__ . '/compat/wordpress-6.8/class-gutenberg-rest-user-controller.php'; +require __DIR__ . '/compat/wordpress-6.8/block-template-utils.php'; // Experimental features. require __DIR__ . '/experimental/block-editor-settings-mobile.php';