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

Site Editor: Set the <title> on the list page to be same as the CPT name #36805

Merged
merged 2 commits into from Nov 24, 2021

Conversation

noisysocks
Copy link
Member

Description

See #36597.

Changes the <title> on the list page to be the name of the CPT being edited, e.g. 'Templates'.

How has this been tested?

  1. Open the site editor.
  2. Open the W menu.
  3. Browse to Templates or Template Parts.
  4. Notice that the window title is Templates or Template Parts.

Screenshots

Before After
Screen Shot 2021-11-24 at 3 18 25 pm Screen Shot 2021-11-24 at 3 18 30 pm

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).

@noisysocks noisysocks added Backport to WP Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") labels Nov 24, 2021
Copy link
Contributor

@talldan talldan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well, thanks 👍

@noisysocks noisysocks merged commit 8113d35 into trunk Nov 24, 2021
@noisysocks noisysocks deleted the fix/title-on-site-editor-list-page branch November 24, 2021 06:27
@github-actions github-actions bot added this to the Gutenberg 12.1 milestone Nov 24, 2021
}
}
}
add_action( 'load-appearance_page_gutenberg-edit-site', 'gutenberg_set_site_editor_list_page_title' );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for not using the admin_title filter - https://developer.wordpress.org/reference/hooks/admin_title/?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to write this in a way that's pretty close to how it will look when added to Core, which is that we'll just change $title here:

https://github.com/WordPress/wordpress-develop/blob/37abb3a4707ea81696eea516b84e0cfc7c70327d/src/wp-admin/site-editor.php#L27

@noisysocks noisysocks removed the Backport to WP Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Nov 28, 2021
noisysocks added a commit that referenced this pull request Nov 29, 2021
…ame (#36805)

* Site Editor: Set the <title> on the list page to be same as the CPT name

* Remove unused argument
@youknowriad
Copy link
Contributor

Is this code still required now that we moved to frontend routing?

@Mamaduka
Copy link
Member

Mamaduka commented Dec 9, 2021

@youknowriad, it's not. We handle document title update on the client-side now.

@noisysocks
Copy link
Member Author

We should be able to just revert this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing")
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants