Fix Table of Contents block links on initial page save#70386
Fix Table of Contents block links on initial page save#70386Sukhendu2002 wants to merge 1 commit intoWordPress:trunkfrom
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @mahnunchik, @Greatdane. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
| let headingPageLink = null; | ||
|
|
||
| // If the core/editor store is available, we can add permalinks to the | ||
| // generated table of contents. | ||
| if ( typeof permalink === 'string' ) { | ||
| headingPageLink = isPaginated | ||
| ? addQueryArgs( permalink, { page: headingPage } ) | ||
| : permalink; | ||
| } |
There was a problem hiding this comment.
Removing this logic will break the ToC block in paginated pages/posts. If I remember correctly, that was the reason it requires a permalink.
What?
Closes: #43595
Fixes Table of Contents block links that don't work on initial page save.
Testing Instructions
Screenshots or screencast
Before
before.mp4
After
after.mp4