From a586f6c2941d95777726764f4da1df98c87039f9 Mon Sep 17 00:00:00 2001 From: ntsekouras Date: Fri, 26 Apr 2024 15:35:46 +0300 Subject: [PATCH] Update template and template parts labels --- lib/compat/wordpress-6.6/post.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lib/compat/wordpress-6.6/post.php b/lib/compat/wordpress-6.6/post.php index 42707989fc082..8415f3bf42f18 100644 --- a/lib/compat/wordpress-6.6/post.php +++ b/lib/compat/wordpress-6.6/post.php @@ -13,3 +13,27 @@ function gutenberg_add_excerpt_support_to_wp_block() { } add_action( 'init', 'gutenberg_add_excerpt_support_to_wp_block' ); + +/** + * Updates the labels for the template post type. + * + * @param object $labels Object with labels for the post type as member variables. + * @return object Object with all the labels as member variables. + */ +function gutenberg_update_wp_template_labels( $labels ) { + $labels->item_updated = __( 'Template updated.', 'gutenberg' ); + return $labels; +} +add_filter( 'post_type_labels_wp_template', 'gutenberg_update_wp_template_labels', 10, 1 ); + +/** + * Updates the labels for the template parts post type. + * + * @param object $labels Object with labels for the post type as member variables. + * @return object Object with all the labels as member variables. + */ +function gutenberg_update_wp_template__part_labels( $labels ) { + $labels->item_updated = __( 'Template part updated.', 'gutenberg' ); + return $labels; +} +add_filter( 'post_type_labels_wp_template_part', 'gutenberg_update_wp_template__part_labels', 10, 1 );