diff --git a/src/js/src/posts-sidebar/index.js b/src/js/src/posts-sidebar/index.js index f6a997f4..248d06fa 100644 --- a/src/js/src/posts-sidebar/index.js +++ b/src/js/src/posts-sidebar/index.js @@ -4,6 +4,8 @@ import { Component, Fragment } from '@wordpress/element'; import { Modal, Button } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; import JeoGeocodePosts from './geo-posts'; +import { useSelect } from '@wordpress/data'; + const JeoGeocodePanel = class JeoGeocodePanel extends Component { constructor() { @@ -38,10 +40,19 @@ const JeoGeocodePanel = class JeoGeocodePanel extends Component { registerPlugin( 'jeo-posts-sidebar', { icon: null, render: () => { - return ( - - - - ); + + const currentPostType = useSelect( ( select ) => { + return select( 'core/editor' ).getCurrentPostType() + }, [] ); + + return ( +
+ { currentPostType === "post" ? + + + + : null }; +
+ ) }, } );