godaddy-wordpress / godaddy-wordpress/coblocks

Click to Tweet block using incorrect slug for scheduled posts

Open
#1,992 0 comments 0 reactions 1 assignee Claimed by @gmays View on GitHub
[Priority] Low [Type] Bug
Dominant language
JavaScript
Stars
794
Forks
142
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug:
When adding a Click to Tweet block, I should be able to set it up and it will work when the post is published. However, if you adding the block and schedule the post for some future date, the date in the URL that the block provides will still be the date on which you clicked 'schedule' and not the date that it was actually published. If you edit the post after it has been published then it will correct the URL in the tweet block, but that sort of defeats the point of scheduling a post.

This looks like the same problem causing the bug in #1663, but I can't say that with certainty.

### To reproduce:
1. Make sure your site uses the post date in the post permalinks
2. Add a 'Click to Tweet' block to a post
2. Schedule the post to be published on any future date (even the following day)
3. Once published, click the 'tweet' button in the block and you'll see the date in the URL is the date on which you created the post, not the actual publish date - this causes a broken link in the tweet

### Expected behavior:
I expect that the URL in the tweet would update to be whatever the post's URL is, rather than storing the URL in the block itself.

### Isolating the problem:
- [x] This bug happens with no other plugins activated
- [x] This bug happens with a default WordPress theme active
- [x] This bug happens **without** the Gutenberg plugin active
- [x] I can reproduce this bug consistently using the steps above

### WordPress version:
5.8

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.