Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update template and template parts labels #61146

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 24 additions & 0 deletions lib/compat/wordpress-6.6/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );