From 0b185ea54e3f6527fd14be756b7413a67f566a47 Mon Sep 17 00:00:00 2001 From: Nik Tsekouras Date: Fri, 26 Apr 2024 17:08:46 +0300 Subject: [PATCH] Update template and template parts labels (#61146) Co-authored-by: ntsekouras Co-authored-by: Mamaduka Co-authored-by: youknowriad --- 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 );