aaroneaton / better-yourls

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

id in pre_get_shortlink can be zero #1

Closed jasgripen closed 9 years ago

jasgripen commented 9 years ago

$id in function pre_get_shortlink is 0 if it's called for the current blog post so the id needs to come from the post instead. Otherwise wordpress will not serve the youlrs url in the shortlink meta tag and http header.

Benunc commented 9 years ago

Yes! I changed that line, and it worked on my end! Thanks! I pored over that function (I had isolated it as the culprit, but couldn't figure out what was causing it to fail back to $shortlink)

Thanks jasgrlpen!

ChrisWiegman commented 9 years ago

My apologies for the [very] late reply here. I finally have some time to get back to this so I'll be looking at this PR over the weekend