1311 add edit with yoast bulk editor entry to wp admin content type bulk actions dropdown - #23488
Conversation
Coverage Report for CI Build 0Warning Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes. Coverage increased (+0.1%) to 55.747%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
…iew cannot be shown in the Bulk editor
There was a problem hiding this comment.
Pull request overview
Adds a Yoast “Bulk edit” bulk action to supported WordPress post-type overview screens, redirecting into the Yoast bulk editor with the selected IDs (capped to the batch limit) carried over and reflected in the bulk editor UI.
Changes:
- Introduces a new wp-admin list-table bulk action integration that redirects to the bulk editor with a carried selection (and hides the action on Trash view).
- Extends the bulk editor REST/query pipeline to support an
include(ID restriction) and adds client-side “Overview selection” filtering plus truncation/exclusion notices. - Adds/updates unit tests across PHP and JS for the new selection-carryover, filtering, and notice behaviors.
Reviewed changes
Copilot reviewed 40 out of 40 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/Unit/Helpers/Current_Page_Helper_Test.php | Adds unit coverage for Current_Page_Helper::is_trash_overview(). |
| tests/Unit/Bulk_Editor/User_Interface/Posts_Route/Register_Routes_Test.php | Verifies REST route schema includes the new include parameter. |
| tests/Unit/Bulk_Editor/User_Interface/Posts_Route/Get_Posts_Test.php | Adds test coverage ensuring included IDs are deduped and propagated into Posts_Query. |
| tests/Unit/Bulk_Editor/User_Interface/Posts_Overview_Bulk_Actions_Integration/Register_Hooks_Test.php | Tests that the integration registers its admin_init hook. |
| tests/Unit/Bulk_Editor/User_Interface/Posts_Overview_Bulk_Actions_Integration/Register_Bulk_Actions_Test.php | Tests capability gating and per-post-type filter registration. |
| tests/Unit/Bulk_Editor/User_Interface/Posts_Overview_Bulk_Actions_Integration/Handle_Bulk_Action_Test.php | Tests redirect URL building, ID sanitization, and batch truncation behavior. |
| tests/Unit/Bulk_Editor/User_Interface/Posts_Overview_Bulk_Actions_Integration/Get_Conditionals_Test.php | Verifies conditionals configuration for the integration. |
| tests/Unit/Bulk_Editor/User_Interface/Posts_Overview_Bulk_Actions_Integration/Constructor_Test.php | Confirms constructor wiring for dependencies. |
| tests/Unit/Bulk_Editor/User_Interface/Posts_Overview_Bulk_Actions_Integration/Add_Bulk_Action_Test.php | Verifies optgroup/label output, RTL arrow behavior, and Trash suppression. |
| tests/Unit/Bulk_Editor/User_Interface/Posts_Overview_Bulk_Actions_Integration/Abstract_Posts_Overview_Bulk_Actions_Integration_Test.php | Provides shared setup/mocks for the new integration’s test suite. |
| tests/Unit/Bulk_Editor/User_Interface/Bulk_Editor_Integration/Register_Hooks_Test.php | Updates expectations to include the removable_query_args filter on the bulk editor page. |
| tests/Unit/Bulk_Editor/User_Interface/Bulk_Editor_Integration/Get_Initial_Selection_Test.php | Adds unit tests for parsing/sanitizing carried-over selection from URL params. |
| tests/Unit/Bulk_Editor/User_Interface/Bulk_Editor_Integration/Enqueue_Assets_Test.php | Updates localized script data expectations to include initialSelection. |
| tests/Unit/Bulk_Editor/User_Interface/Bulk_Editor_Integration/Add_Removable_Query_Args_Test.php | Adds coverage for registering post_ids/selected_count as removable query args. |
| tests/Unit/Bulk_Editor/Infrastructure/Posts/Indexable_Posts_Collector/Get_Posts_Test.php | Adds coverage for applying an include-ID restriction at the indexables query layer. |
| tests/Unit/Bulk_Editor/Domain/Posts/Posts_Query_Test.php | Adds coverage for new include-IDs API on Posts_Query. |
| src/helpers/current-page-helper.php | Adds is_trash_overview() helper to detect Trash view on admin overviews. |
| src/bulk-editor/user-interface/posts-route.php | Extends REST schema + request handling to accept/dedupe included post IDs. |
| src/bulk-editor/user-interface/posts-overview-bulk-actions-integration.php | New integration adding the “Bulk edit” dropdown entry and redirect handler. |
| src/bulk-editor/user-interface/bulk-editor-integration.php | Adds URL param constants, initial selection parsing, and removable query args hook. |
| src/bulk-editor/infrastructure/posts/post-meta-posts-collector.php | Applies post__in constraint when Posts_Query has include IDs. |
| src/bulk-editor/infrastructure/posts/indexable-posts-collector.php | Applies where_in(object_id, …) constraint when include IDs are present. |
| src/bulk-editor/domain/posts/posts-query.php | Extends Posts_Query to carry include IDs and expose has_include()/get_include_ids(). |
| packages/js/tests/bulk-editor/store/selection.test.js | Adds test coverage for carried-over selection totals, pruning, and exclusion notice state. |
| packages/js/tests/bulk-editor/store/query.test.js | Adds test coverage for overview selection filter state and selectors. |
| packages/js/tests/bulk-editor/services/use-posts.test.js | Adds coverage for include requests and selection pruning behavior while overview filter is active. |
| packages/js/tests/bulk-editor/overview-selection-notice.test.js | New tests for the truncation notice and its integration into the bulk-actions band. |
| packages/js/tests/bulk-editor/overview-exclusion-notice.test.js | New tests for the exclusion notice and stacked-notice behavior. |
| packages/js/tests/bulk-editor/initialize.test.js | Adds seeding tests for carried-over preselection state from wpseoBulkEditorData.initialSelection. |
| packages/js/tests/bulk-editor/bulk-editor-filters.test.js | Adds tests for offering/toggling the “Overview selection” filter. |
| packages/js/tests/bulk-editor/bulk-editor-content.test.js | Adds tests for selection-view semantics with off-page IDs + bulk-actions band expansion logic. |
| packages/js/src/bulk-editor/store/selection.js | Extends selection state with carried-over totals, pruning, and notice dismissal actions. |
| packages/js/src/bulk-editor/store/query.js | Adds overview selection IDs + “overview filter active” state and reducers/selectors. |
| packages/js/src/bulk-editor/services/use-posts.js | Adds conditional include querying and selection pruning based on fetched editable rows. |
| packages/js/src/bulk-editor/initialize.js | Seeds the store with carried-over selection and activates the overview filter when applicable. |
| packages/js/src/bulk-editor/components/overview-selection-notice.js | Adds truncation notice component for “> batch size selected” carry-over scenarios. |
| packages/js/src/bulk-editor/components/overview-exclusion-notice.js | Adds exclusion notice component for carried-over IDs dropped during pruning. |
| packages/js/src/bulk-editor/components/bulk-editor-filters.js | Adds “Overview selection” checkbox filter and counts it in the applied-filters badge. |
| packages/js/src/bulk-editor/components/bulk-editor-content.js | Ensures selection semantics work with off-page IDs and expands the band for overview notices. |
| packages/js/src/bulk-editor/components/bulk-action-bar.js | Renders truncation/exclusion notices in the notices region and wires dismissal handlers. |
…rating the "needs improvement group" filters
vraja-pro
left a comment
There was a problem hiding this comment.
Two non-blocking nits on the PR itself:
Changelog label — the PR is labelled changelog: non-user-facing but adds a visible "Bulk edit ↗" entry to every supported post overview, plus notices and an auto-filter in the bulk editor. This is user-facing and should be changelog: enhancement.
Trailing space in changelog bullet — "…each supported post type ." has a space before the period.
|
A merge conflict has been detected for the proposed code changes in this PR. Please resolve the conflict by either rebasing the PR or merging in changes from the base branch. |
…11-add-edit-with-yoast-bulk-editor-entry-to-wp-admin-content-type-bulk-actions-dropdown # Conflicts: # packages/js/src/bulk-editor/initialize.js # packages/js/tests/bulk-editor/initialize.test.js # src/bulk-editor/user-interface/bulk-editor-integration.php # tests/Unit/Bulk_Editor/User_Interface/Bulk_Editor_Integration/Enqueue_Assets_Test.php
I think we want it this way because this PR is going to be merged in a feature branch, which will expose the "real" changelog label (presumably |
vraja-pro
left a comment
There was a problem hiding this comment.
Lets follow the same pattern in https://github.com/Yoast/wordpress-seo-premium/pull/5040 by removing the content type label and remove the space between the notices untill we get a clear answer from UX.
|
A merge conflict has been detected for the proposed code changes in this PR. Please resolve the conflict by either rebasing the PR or merging in changes from the base branch. |
…11-add-edit-with-yoast-bulk-editor-entry-to-wp-admin-content-type-bulk-actions-dropdown # Conflicts: # packages/js/src/bulk-editor/components/bulk-editor-content.js # packages/js/tests/bulk-editor/bulk-editor-content.test.js # packages/js/tests/bulk-editor/hooks/use-posts.test.js
Context
Summary
This PR can be summarized in the following changelog entry:
Bulk editfeature to overview pages related to each supported post type.Relevant technical choices:
admin_initfor each supported content type via thebulk_actions-edit-{post_type}/handle_bulk_actions-edit-{post_type}filters, guarded by thewpseo_manage_optionscapability.<img>, which is invalid inside<select>.wp_safe_redirect()+exit:handle_bulk_actions-*is a filter and core performs the redirect itself — this follows the API contract and keeps the handler unit-testable.selected_countparam that drives the ">20" notice. Usingselected_countallows to keep the redirect URL bounded because the overview can list up to 999 rows per page.Current_Page_Helper::is_trash_overview(), which mirrors core's internalWP_Posts_List_Table.post_idsandselected_countare registered asremovable_query_argsso the address bar is scrubbed after load.Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
Setup
The dropdown entry
Carry a small selection over (happy path)
URL cleanup (one-shot parameters)
post_idsandselected_countparameters are removed automatically shortly after the page loads (content_typestays).The "Overview selection" filter
More than 20 selected: the truncation notice
The exclusion notice (carried posts the bulk editor cannot show)
Both notices at the same time (>20 selected AND some excluded)
Posts the bulk editor cannot show are dropped from the selection
Permissions
wpseo_manage_optionscapability).Other content types
Hand-crafted URLs (defensive handling)
wp-admin/admin.php?page=wpseo_page_bulk_edit&content_type=bogus&post_ids=1,2,3&selected_count=3.post_ids=abc,-5,0: same clean result.(Optional) RTL
Confirm the bulk editor still works when opened directly (no regression)
Relevant test scenarios
Test instructions for QA when the code is in the RC
Impact check
This PR affects the following parts of the plugin, which may require extra testing:
Other environments
[shopify-seo], added test instructions for Shopify and attached theShopifylabel to this PR.[yoast-doc-extension], added test instructions for Yoast SEO for Google Docs and attached theGoogle Docs Add-onlabel to this PR.Documentation
Quality assurance
grunt build:imagesand committed the results, if my PR introduces or edits images or SVGs.Innovation
innovationlabel.Fixes https://github.com/Yoast/reserved-tasks/issues/1311