File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change 11import classnames from 'classnames' ;
22import { InnerBlocks , useBlockProps } from '@wordpress/block-editor' ;
3- import { PostPicker , useParentBlock } from '@alleyinteractive/block-editor-tools' ;
4- import { dispatch , useSelect } from '@wordpress/data' ;
3+ import { PostPicker } from '@alleyinteractive/block-editor-tools' ;
4+ import { dispatch , select , useSelect } from '@wordpress/data' ;
55import { __ } from '@wordpress/i18n' ;
66
77import NoRender from './norender' ;
@@ -19,13 +19,6 @@ interface PostEditProps {
1919 isSelected : boolean ;
2020}
2121
22- interface ParentBlock {
23- attributes ?: {
24- posts : Array < number | null > ;
25- postTypes : string [ ] ;
26- } ;
27- }
28-
2922/**
3023 * The wp-curate/post block edit function.
3124 *
@@ -41,7 +34,10 @@ export default function Edit({
4134 } ,
4235 isSelected,
4336} : PostEditProps ) {
44- const queryParent : ParentBlock = useParentBlock ( clientId ) ?? { } ;
37+ // @ts -ignore
38+ const queryParentId = select ( 'core/block-editor' ) . getBlockParentsByBlockName ( clientId , 'wp-curate/query' ) [ 0 ] ;
39+ // @ts -ignore
40+ const queryParent = select ( 'core/block-editor' ) . getBlock ( queryParentId ) ?? { } ;
4541 const {
4642 attributes : {
4743 posts = [ ] ,
You can’t perform that action at this time.
0 commit comments