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

Document Actions: Use page name for header info section #25594

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
6 changes: 2 additions & 4 deletions packages/edit-site/src/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export default function Header( {
const {
deviceType,
hasFixedToolbar,
template,
templateId,
templatePartId,
templateType,
Expand All @@ -53,7 +52,7 @@ export default function Header( {
getPage,
} = select( 'core/edit-site' );

const { getEntityRecord, getEditedEntityRecord } = select( 'core' );
const { getEditedEntityRecord } = select( 'core' );
const { show_on_front: _showOnFront } = getEditedEntityRecord(
'root',
'site'
Expand All @@ -64,7 +63,6 @@ export default function Header( {
deviceType: __experimentalGetPreviewDeviceType(),
hasFixedToolbar: isFeatureActive( 'fixedToolbar' ),
templateId: _templateId,
template: getEntityRecord( 'postType', 'wp_template', _templateId ),
templatePartId: getTemplatePartId(),
templateType: getTemplateType(),
page: getPage(),
Expand Down Expand Up @@ -138,7 +136,7 @@ export default function Header( {
</div>

<div className="edit-site-header_center">
<DocumentActions documentTitle={ template?.slug } />
<DocumentActions documentTitle={ page?.label } />
</div>

<div className="edit-site-header_end">
Expand Down
1 change: 1 addition & 0 deletions packages/edit-site/src/components/page-switcher/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export default function PageSwitcher( {
slug: post.slug,
path: getPathAndQueryString( post.url ),
context: { postType: post.type, postId: post.id },
label: post.title,
} );

const activePath = activePage?.path;
Expand Down
2 changes: 2 additions & 0 deletions packages/edit-site/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* WordPress dependencies
*/
import { select, dispatch, apiFetch } from '@wordpress/data-controls';
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
Expand Down Expand Up @@ -147,6 +148,7 @@ export function* showHomepage() {

const page = {
path: '/',
label: showOnFront === 'page' ? __( 'Homepage' ) : __( 'All Posts' ),
Copy link
Member Author

Choose a reason for hiding this comment

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

could just change this to homepage. (and then also update that in the page selector)

context:
showOnFront === 'page'
? {
Expand Down