Skip to content

Commit

Permalink
Site Editor: Add Page Attributes panel (#57151)
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad authored and artemiomorales committed Jan 4, 2024
1 parent 34e8744 commit 8c9f50a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { store as interfaceStore } from '@wordpress/interface';
import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
import {
store as editorStore,
PageAttributesPanel,
PostDiscussionPanel,
PostExcerptPanel,
PostFeaturedImagePanel,
Expand All @@ -25,7 +26,6 @@ import {
*/
import SettingsHeader from '../settings-header';
import PostStatus from '../post-status';
import PageAttributes from '../page-attributes';
import MetaBoxes from '../../meta-boxes';
import PluginDocumentSettingPanel from '../plugin-document-setting-panel';
import PluginSidebarEditPost from '../plugin-sidebar';
Expand Down Expand Up @@ -86,7 +86,7 @@ const SidebarContent = ( {
<PostFeaturedImagePanel />
<PostExcerptPanel />
<PostDiscussionPanel />
<PageAttributes />
<PageAttributesPanel />
<MetaBoxes location="side" />
</>
) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { useSelect } from '@wordpress/data';
import { store as coreStore } from '@wordpress/core-data';
import { decodeEntities } from '@wordpress/html-entities';
import {
PageAttributesPanel,
PostDiscussionPanel,
PostExcerptPanel,
PostFeaturedImagePanel,
Expand Down Expand Up @@ -106,6 +107,7 @@ export default function PagePanels() {
<PostFeaturedImagePanel />
<PostExcerptPanel />
<PostDiscussionPanel />
<PageAttributesPanel />
</>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import { useSelect } from '@wordpress/data';
import { PanelBody } from '@wordpress/components';
import {
PageAttributesPanel,
PostDiscussionPanel,
PostExcerptPanel,
PostFeaturedImagePanel,
Expand Down Expand Up @@ -70,6 +71,7 @@ export default function TemplatePanel() {
<PostFeaturedImagePanel />
<PostExcerptPanel />
<PostDiscussionPanel />
<PageAttributesPanel />
</>
);
}
1 change: 1 addition & 0 deletions packages/editor/src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export { default as ErrorBoundary } from './error-boundary';
export { default as LocalAutosaveMonitor } from './local-autosave-monitor';
export { default as PageAttributesCheck } from './page-attributes/check';
export { default as PageAttributesOrder } from './page-attributes/order';
export { default as PageAttributesPanel } from './page-attributes/panel';
export { default as PageAttributesParent } from './page-attributes/parent';
export { default as PageTemplate } from './post-template/classic-theme';
export { default as PostTemplatePanel } from './post-template/panel';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
*/
import { __ } from '@wordpress/i18n';
import { PanelBody, PanelRow } from '@wordpress/components';
import {
store as editorStore,
PageAttributesCheck,
PageAttributesOrder,
PageAttributesParent,
} from '@wordpress/editor';

import { useSelect, useDispatch } from '@wordpress/data';
import { store as coreStore } from '@wordpress/core-data';

/**
* Module Constants
* Internal dependencies
*/
import { store as editorStore } from '../../store';
import PageAttributesCheck from './check';
import PageAttributesOrder from './order';
import PageAttributesParent from './parent';

const PANEL_NAME = 'page-attributes';

export function PageAttributes() {
export function PageAttributesPanel() {
const { isEnabled, isOpened, postType } = useSelect( ( select ) => {
const {
getEditedPostAttribute,
Expand Down Expand Up @@ -59,4 +59,4 @@ export function PageAttributes() {
);
}

export default PageAttributes;
export default PageAttributesPanel;

0 comments on commit 8c9f50a

Please sign in to comment.