File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 44import apiFetch from '@wordpress/api-fetch' ;
55import { __ , sprintf } from '@wordpress/i18n' ;
66import { addQueryArgs } from '@wordpress/url' ;
7+ import { applyFilters } from '@wordpress/hooks' ;
78
89/**
910 * External dependencies.
@@ -339,20 +340,27 @@ export const warningForPopup = ( prompts, prompt ) => {
339340 ) ;
340341 } ) ;
341342
342- if ( 0 < conflictingPrompts . length ) {
343+ const filteredConflictingPrompts = applyFilters (
344+ 'newspack.wizards.campaigns.conflictingPrompts' ,
345+ conflictingPrompts ,
346+ prompt ,
347+ prompts
348+ ) ;
349+
350+ if ( 0 < filteredConflictingPrompts . length ) {
343351 return (
344352 < >
345353 < strong >
346354 { sprintf (
347355 // Translators: %s: 'Conflicts' or 'Conflict' depending on number of conflicts.
348356 __ ( '%s detected:' , 'newspack' ) ,
349- 1 < conflictingPrompts . length
357+ 1 < filteredConflictingPrompts . length
350358 ? __ ( 'Conflicts' , 'newspack' )
351359 : __ ( 'Conflict' , 'newspack' )
352360 ) }
353361 </ strong >
354362 < ul >
355- { conflictingPrompts . map ( conflictingPrompt => (
363+ { filteredConflictingPrompts . map ( conflictingPrompt => (
356364 < li key = { conflictingPrompt . id } >
357365 < p data-testid = { `conflict-warning-${ prompt . id } ` } >
358366 < strong > { sprintf ( '%s: ' , conflictingPrompt . title ) } </ strong >
You can’t perform that action at this time.
0 commit comments