@@ -59,44 +59,6 @@ import {
59
59
import { useMergeRefs , useRefEffect } from '@wordpress/compose' ;
60
60
import { useSelect , useDispatch } from '@wordpress/data' ;
61
61
62
- /**
63
- * Given the Link block's type attribute, return the query params to give to
64
- * /wp/v2/search.
65
- *
66
- * @param {string } type Link block's type attribute.
67
- * @param {string } kind Link block's entity of kind (post-type|taxonomy)
68
- * @return {{ type?: string, subtype?: string } } Search query params.
69
- */
70
- function getSuggestionsQuery ( type , kind ) {
71
- switch ( type ) {
72
- case 'post' :
73
- case 'page' :
74
- return { type : 'post' , subtype : type } ;
75
- case 'category' :
76
- return { type : 'term' , subtype : 'category' } ;
77
- case 'tag' :
78
- return { type : 'term' , subtype : 'post_tag' } ;
79
- case 'post_format' :
80
- return { type : 'post-format' } ;
81
- default :
82
- if ( kind === 'taxonomy' ) {
83
- return { type : 'term' , subtype : type } ;
84
- }
85
- if ( kind === 'post-type' ) {
86
- return { type : 'post' , subtype : type } ;
87
- }
88
- return {
89
- // for custom link which has no type
90
- // always show pages as initial suggestions
91
- initialSuggestionsSearchOptions : {
92
- type : 'post' ,
93
- subtype : 'page' ,
94
- perPage : 20 ,
95
- } ,
96
- } ;
97
- }
98
- }
99
-
100
62
const LINK_SETTINGS = [
101
63
...LinkControl . DEFAULT_LINK_SETTINGS ,
102
64
{
@@ -273,8 +235,7 @@ function ButtonEdit( props ) {
273
235
return { } ;
274
236
}
275
237
276
- const { getSettings } = select ( blockEditorStore ) ;
277
- const _settings = getSettings ( ) ;
238
+ const _settings = select ( blockEditorStore ) . getSettings ( ) ;
278
239
279
240
const blockBindingsSource = getBlockBindingsSource (
280
241
metadata ?. bindings ?. url ?. source
@@ -484,11 +445,6 @@ function ButtonEdit( props ) {
484
445
}
485
446
withCreateSuggestion = { userCanCreatePages }
486
447
createSuggestionButtonText = { createButtonText }
487
- showInitialSuggestions
488
- suggestionsQuery = { getSuggestionsQuery (
489
- 'page' ,
490
- 'post-type'
491
- ) }
492
448
/>
493
449
</ Popover >
494
450
) }
0 commit comments