aaroneaton / better-yourls

Source code for the Better YOURLS WordPress plugin
21 stars 6 forks source link

[WIP] Fix scheduled posts not having nice urls #13

Closed stayallive closed 8 years ago

stayallive commented 8 years ago

When calling get_permalink on a post with the status future the permalink is the preview url (http://site.com?id=123456), this is undesirable behaviour since this looks bad and causes another redirect.

This happens for some Twitter plugins for example, they create the tweet before the post is published so wp_get_shortlink() is called while the post is still scheduled.

However this "fix" probably only works when using the post name permalink setting I wanted to show it here to discuss fixes we can do to make this behave better.

stayallive commented 8 years ago

Also we just noticed that because you are now checking if the CRON is running in the filter_get_shortlink that future posts are unable to get a shorturl alltogether...

ChrisWiegman commented 8 years ago

Thanks for the reports and the PR! I'm a bit swamped with WordCamp US this week but I hope to get to this ASAP.

stayallive commented 8 years ago

Closing this in favor of the changes in ChrisWiegman/Better-YOURLS/feature/jetpack-share-links.

ChrisWiegman commented 8 years ago

Thank you for the confirmation. I'll try to get that out this week

stayallive commented 8 years ago

Woops didn't mean to open this again, I'll create an issue!