Repository navigation
Conversation
…l interfaces. Unifies behavior across core by allowing password protected posts to be sticky: - Removes the sticky/password rejection in WP_REST_Posts_Controller. - Avoids unsetting the sticky flag in edit_post() and write_post() when visibility is password. - Relaxes the sticky restriction in wp_xmlrpc_server::_toggle_sticky() so only private posts cannot be sticky. - Updates the Classic Editor visibility UI to display and maintain sticky status for password-protected posts. - Updates REST API, admin, and XML-RPC unit tests. See #64810.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
…word protected. The three update tests still asserted the old 400 rest_invalid_field response. The duplicate of the update case already covered by test_update_post_with_password_and_sticky_succeeds() is removed; the other two now assert that the request succeeds and the post keeps both its password and its sticky state. See #64810.
|
The first CI run had 3 failures, all in Fixed in 179542e:
Locally, all 288 |
Allows password-protected posts to be sticky across all interfaces in WordPress core, following the direction proposed by @wildworks in comment:29 and verified by @jolanc in comment:33 and comment:34:
WP_REST_Posts_Controller): Removes the 400rest_invalid_fieldrejection when creating or updating a post with both a password andsticky = true.edit_post()andwp_write_post()): Stops unsettingstickywhenvisibilityispassword(private posts remain non-sticky).wp_xmlrpc_server::_toggle_sticky()): Relaxes the sticky guard so onlyprivateposts are rejected.post_submit_meta_box()andsrc/js/_enqueues/admin/post.js): Keeps the "Stick this post to the front page" checkbox available when "Password protected" is selected and displaysPassword protected, Stickywhen active.WP_REST_Posts_Controller,edit_post(), andwp_xmlrpc_server::wp_newPost().Note: PR #13246 implements the narrower alternative (unsticking on Quick Edit when a password is set). Both PRs are available depending on final committer sign-off on Trac.
Trac ticket: https://core.trac.wordpress.org/ticket/64810
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.