Skip to content

Commit f207c54

Browse files
fix warning isEditingTemplate is deprecated
1 parent 60e5ed7 commit f207c54

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/deprecated/v2/higher-order/with-google-font/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const withGoogleFont = createHigherOrderComponent(
1414
WrappedComponent => {
1515
const NewComponent = props => {
1616
const isEditingTemplate = useSelect( select =>
17-
select( 'core/edit-post' )?.isEditingTemplate?.()
17+
select( 'core/editor' )?.getCurrentPostType?.() === 'wp_template' || false
1818
)
1919

2020
// Reload the Google Fonts in the editor when switching to and from page template editing.

src/plugins/global-settings/colors/editor-loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const renderGlobalStyles = ( newColors, isEditingTemplate, setStyles ) => {
4848
export const GlobalColorStyles = () => {
4949
const { colors, isEditingTemplate } = useSelect( select => ( {
5050
colors: select( 'stackable/global-colors' ).getSettings().stackableColors || [],
51-
isEditingTemplate: select( 'core/edit-post' )?.isEditingTemplate?.() || false,
51+
isEditingTemplate: select( 'core/editor' )?.getCurrentPostType?.() === 'wp_template' || false,
5252
} ) )
5353
const [ styles, setStyles ] = useState( '' )
5454

0 commit comments

Comments
 (0)