2
2
* WordPress dependencies
3
3
*/
4
4
import { useId } from '@wordpress/element' ;
5
- import { __ , sprintf , _x } from '@wordpress/i18n' ;
5
+ import { __ , sprintf } from '@wordpress/i18n' ;
6
6
import {
7
7
DropdownMenu ,
8
8
ToolbarGroup ,
@@ -22,13 +22,10 @@ import useBlockDisplayTitle from '../block-title/use-block-display-title';
22
22
23
23
export default function BlockBindingsToolbarIndicator ( { clientIds } ) {
24
24
const isSingleBlockSelected = clientIds . length === 1 ;
25
- const { icon, firstBlockName, isConnectedToPatternOverrides } = useSelect (
25
+ const { icon, firstBlockName } = useSelect (
26
26
( select ) => {
27
- const {
28
- getBlockAttributes,
29
- getBlockNamesByClientId,
30
- getBlocksByClientId,
31
- } = select ( blockEditorStore ) ;
27
+ const { getBlockAttributes, getBlockNamesByClientId } =
28
+ select ( blockEditorStore ) ;
32
29
const { getBlockType, getActiveBlockVariation } =
33
30
select ( blocksStore ) ;
34
31
const blockTypeNames = getBlockNamesByClientId ( clientIds ) ;
@@ -54,14 +51,6 @@ export default function BlockBindingsToolbarIndicator( { clientIds } ) {
54
51
icon : _icon ,
55
52
firstBlockName : getBlockAttributes ( clientIds [ 0 ] ) . metadata
56
53
. name ,
57
- isConnectedToPatternOverrides : getBlocksByClientId (
58
- clientIds
59
- ) . some ( ( block ) =>
60
- Object . values ( block ?. attributes . metadata ?. bindings ) . some (
61
- ( binding ) =>
62
- binding . source === 'core/pattern-overrides'
63
- )
64
- ) ,
65
54
} ;
66
55
} ,
67
56
[ clientIds , isSingleBlockSelected ]
@@ -71,25 +60,15 @@ export default function BlockBindingsToolbarIndicator( { clientIds } ) {
71
60
maximumLength : 35 ,
72
61
} ) ;
73
62
74
- let blockDescription = isSingleBlockSelected
75
- ? _x (
76
- 'This block is connected.' ,
77
- 'block toolbar button label and description'
63
+ const blockDescription = isSingleBlockSelected
64
+ ? sprintf (
65
+ /* translators: %1s: The block type's name; %2s: The block's user-provided name (the same as the override name). */
66
+ __ ( 'This %1$s is editable using the "%2$s" override.' ) ,
67
+ firstBlockTitle . toLowerCase ( ) ,
68
+ firstBlockName
78
69
)
79
- : _x (
80
- 'These blocks are connected.' ,
81
- 'block toolbar button label and description'
82
- ) ;
83
- if ( isConnectedToPatternOverrides && firstBlockName ) {
84
- blockDescription = isSingleBlockSelected
85
- ? sprintf (
86
- /* translators: %1s: The block type's name; %2s: The block's user-provided name (the same as the override name). */
87
- __ ( 'This %1$s is editable using the "%2$s" override.' ) ,
88
- firstBlockTitle . toLowerCase ( ) ,
89
- firstBlockName
90
- )
91
- : __ ( 'These blocks are editable using overrides.' ) ;
92
- }
70
+ : __ ( 'These blocks are editable using overrides.' ) ;
71
+
93
72
const descriptionId = useId ( ) ;
94
73
95
74
return (
0 commit comments