-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Try: Improve permalink editing #12009
Conversation
Related: #12031 |
73a5d50
to
038395d
Compare
Rebased and resolved merge conflicts. Still need to apply the updates to the sidebar panel too, but not sure the level of refactoring that should be done at this point right before an RC. Should note again that this PR would require a core patch at merge time. |
@youknowriad I'll look over this again today and see if I can split it up a bit. I think the only thing we could split out would be the application of the preview functionality, though I do think that would be nice to have. The other question around this, would it be more helpful to have a shared permalink component to use between both the title and the sidebar permalink editor instead of duplicating the effort? |
IMO, the title permalink should be deprecated at some point, but if it's easy to factorize a shared component, then, yes, it sounds like a great idea. |
038395d
to
9335715
Compare
I rebased master, stripped out the preview functionality, moved the slug logic to a new I think this probably the minimum required to fix #7129 to allow permalink editing immediately without requiring any saves. There are more improvements that I'll probably try to make in separate PRs, such as recreating the logic from the |
9335715
to
85fa2b2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is looking very good here. Do you think we should land this before the the core patch https://core.trac.wordpress.org/ticket/46266 or maybe wait until the approach is validated. Who do you think can validate that patch?
@youknowriad I'm going to loop @desrosj in today to get his feedback on the core side and see if we should validate with anyone else, but I don't anticipate it being an issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to work well for me. 👍
Can we rebase and land this? |
This somewhat diminishes the effects of this pull request, but it will help it pass the e2e tests and also streamlines writing a bit. Reverts back to preventing showing the permalink editor in the title until after a manual or autosave. It does at least show the actual permalink on the autosave and users can edit the slug at any time using the document sidebar.
c4830d3
to
ddeeb8d
Compare
Rebased. I'll wait for tests to finish and then land it. |
Great work here and thanks for pushing it to the finish line. |
Yep, all 3 are closed now. The last one had some additional discussion on it, but the original basis of the ticket is resolved. I told Andrea he could open it back up if he felt it wasn't resolved. |
I found it interesting that clicking Edit having the save button visible one could click it or just click outside into empty space or another block to automatically close it. Perhaps this method can be used with other features as well. Instead of adding a cancel button one just clicks outside the button and the area it belongs to. |
Description
Allows immediate editing of permalinks, without requiring a save.
Fixes: #7129, #12714, #12031
Notes:
get_sample_permalink()
in core to add theauto-save
status to the list of statuses that are faked to publish. See: /wp-admin/includes/post.php#L1310. In the PR, I just used theget_sample_permalink
filter at the end of the function and passed the parameters back through it, pretending it was published. I will need to open a separate core ticket to address this for whenever it's merged.How has this been tested?
Extensive testing across various post statuses and different orders of editing the slug and/or title and the different methods of saving, publishing and transitioning the post status.