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

Plugin: Avoid setting generic "Edit Post" title on load #13552

Merged
merged 1 commit into from
Jan 29, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,6 @@ function gutenberg_pre_init() {
* @return bool Whether Gutenberg was initialized.
*/
function gutenberg_init( $return, $post ) {
global $title, $post_type;

if ( true === $return && current_filter() === 'replace_editor' ) {
return $return;
}
Expand All @@ -224,17 +222,6 @@ function gutenberg_init( $return, $post ) {
add_filter( 'screen_options_show_screen', '__return_false' );
add_filter( 'admin_body_class', 'gutenberg_add_admin_body_class' );

$post_type_object = get_post_type_object( $post_type );

/*
* Always force <title> to 'Edit Post' (or equivalent)
* because it needs to be in a generic state for both
* post-new.php and post.php?post=<id>.
*/
if ( ! empty( $post_type_object ) ) {
$title = $post_type_object->labels->edit_item;
}

/*
* Remove the emoji script as it is incompatible with both React and any
* contenteditable fields.
Expand Down