Themes: Add filter on bulk action fields.

Because validation was added in [59134] to prevent submitting bulk actions with no selected action, sites that remove or change the default bulk actions can fail due to the missing required inputs. Add a filter (bulk_action_observer_ids) that allows modifying the actions accepted to fulfill validation rules.

Reviewed by Jorbin.
Merges [60186] to the 6.8 branch.

Props ethitter, kabir93, jorbin, davidbaumwald, joedolson.
Fixes #63005.

Built from https://develop.svn.wordpress.org/branches/6.8@60188


git-svn-id: http://core.svn.wordpress.org/branches/6.8@59524 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Aaron Jorbin
2025-04-25 18:38:29 +00:00
parent 690978a7d3
commit 40745ab9c3
4 changed files with 26 additions and 4 deletions

View File

@@ -1327,8 +1327,8 @@ $( function() {
// Observe submissions from posts lists for 'bulk_action' or users lists for 'new_role'.
var bulkFieldRelations = {
'bulk_action' : 'action',
'changeit' : 'new_role'
'bulk_action' : window.bulkActionObserverIds.bulk_action,
'changeit' : window.bulkActionObserverIds.changeit
};
if ( ! Object.keys( bulkFieldRelations ).includes( submitterName ) ) {
return;

File diff suppressed because one or more lines are too long