@@ -207,7 +207,7 @@ const SearchReplaceForBlockEditor = (): JSX.Element => {
207207 select ( 'core/block-editor' )
208208 . getBlocks ( )
209209 . forEach ( ( element : any ) => {
210- recursivelyReplace ( element , pattern , replaceInput , status ) ;
210+ recursivelyReplace ( element , pattern , status ) ;
211211 } ) ;
212212
213213 if ( status && isSavePostEnabled ) {
@@ -271,21 +271,19 @@ const SearchReplaceForBlockEditor = (): JSX.Element => {
271271 *
272272 * @param {any } element Gutenberg editor block.
273273 * @param {RegExp } pattern Search pattern.
274- * @param {string } text Replace pattern.
275274 * @param {boolean } status True (Replace), False (Search).
276275 *
277276 * @return {void }
278277 */
279278 const recursivelyReplace = (
280279 element : any ,
281280 pattern : RegExp ,
282- text : string ,
283281 status : boolean
284282 ) : void => {
285283 const { name, innerBlocks } = element ;
286284
287285 if ( getAllowedBlocks ( ) . indexOf ( name ) !== - 1 ) {
288- const args = { element, pattern, text , status } ;
286+ const args = { element, pattern, status } ;
289287
290288 /**
291289 * Replace Block Attribute.
@@ -310,7 +308,7 @@ const SearchReplaceForBlockEditor = (): JSX.Element => {
310308
311309 if ( innerBlocks . length ) {
312310 innerBlocks . forEach ( ( innerElement : any ) => {
313- recursivelyReplace ( innerElement , pattern , text , status ) ;
311+ recursivelyReplace ( innerElement , pattern , status ) ;
314312 } ) ;
315313 }
316314 } ;
@@ -331,7 +329,6 @@ const SearchReplaceForBlockEditor = (): JSX.Element => {
331329 const property = { } ;
332330 const {
333331 pattern,
334- text,
335332 element : { attributes, clientId, name } ,
336333 status,
337334 } = args ;
@@ -353,7 +350,7 @@ const SearchReplaceForBlockEditor = (): JSX.Element => {
353350 */
354351 const handleAttributeReplacement = ( ) : string => {
355352 setReplacements ( ( items : number ) => items + 1 ) ;
356- return text ;
353+ return replaceInput ;
357354 } ;
358355
359356 /**
0 commit comments