Jetpack: Bug: Twitter Share URL Wrong

Created on 6 Feb 2019  ·  4Comments  ·  Source: Automattic/jetpack

Short Description

While The JetPack Twitter Share work with plugin cos_slug_translator,it will twitter a wrong url

Steps to reproduce the issue

  1. download cos_slug_translator plugin
  2. enable this plugin
  3. connect to twitter
  4. Publish a aritcle and auoto post to Twitter
  5. click Twitter Link, you will get a wrong page.

What I expected

Get the real page

What I think?

the plugin cos_slug_translator use publish_post hook to hook article publish and aritcle update.

due to this plugin change the post_name, the twitter link wrong.

Why i Use this plugin

My Article is written in Chinese, The post_name will translte in browser, like %7E%12%1E%9A, it's ugly. so ,i use this plugin to translate my post name into english.

Publicize

Most helpful comment

Thank you. I see that the title is indeed replaced as the post is being published. It may be best to use the save_post hook instead, so the change can happen as you save your draft:
https://codex.wordpress.org/Plugin_API/Action_Reference/save_post

This should help here.

Another approach would be to also change the text of the text that is sent to Social Networks as you publish the post, as explained here:
https://jeremy.hu/jetpack-hashtags-tweets-publicize/

I hope this helps.

All 4 comments

Could you point me to the plugin's page in the WordPress.org plugin directory, so I can give it a try on my end?

Thank you.

Hi, I upload the plugin code.

this plugin didn't upload to wordpress directory. if we can deal it, i will publish a cos-slug-translator-fix to wordpress plugin directory

cos_slug_translator.zip

Thank you. I see that the title is indeed replaced as the post is being published. It may be best to use the save_post hook instead, so the change can happen as you save your draft:
https://codex.wordpress.org/Plugin_API/Action_Reference/save_post

This should help here.

Another approach would be to also change the text of the text that is sent to Social Networks as you publish the post, as explained here:
https://jeremy.hu/jetpack-hashtags-tweets-publicize/

I hope this helps.

@jeherve Hi, Jeremy, Thanks for you article, Now, I build a new Plugin and can run with JetPack, I open source it at https://github.com/bestony/automatic-translate-slug

I also upload it to wordpress plugin directory!

👍 👍 👍

Was this page helpful?
0 / 5 - 0 ratings