Jetpack: Sharing buttons are added to the rest API output

Created on 19 Jun 2017  Â·  9Comments  Â·  Source: Automattic/jetpack

Visit your sites rest API output. The post excerpt has sharing buttons - it shouldn't be there. I expect to see the sharing buttons only on the front-end, not anywhere else.

Steps to reproduce the issue

Change to your sites URL: https://codepen.io/rami/pen/qjEXLQ

What I expecte

I expect to see the post excerpt (no sharing buttons).

What happened instead

I get the post excerpt with the sharing buttons.

How to fix

When adding share buttons to the post excerpt, it should check if it's not is_feed() or is_trackback() or is_embed() or rest API output.

Sharing WP REST API [Pri] Normal [Status] Stale [Type] Bug

Most helpful comment

I can reproduce now, thank you!

All 9 comments

Related: #4601

@ramiy I can't seem to reproduce the issue with my own site right now. Could you let me know what your sharing settings (under Settings > Sharing) were when you originally reported this issue?

@jeherve

jetpack-sharing-settings

Thanks! Could you click on "Configure your sharing buttons" and show me your settings there?

@jeherve

jetpack-sharing-config

I can reproduce now, thank you!

I was able to reproduce this issue with bleeding edge Jetpack 6.2-beta-18674-03a5e33-master.

Steps to reproduce this issue:

  1. Create new JN site, connect it
  2. Check "Front Page, Archive Pages, and Search Results" option in "Show sharing button on" (Settings > Sharing > Configure your sharing buttons)
  3. Go to https://YOUR-JN-SITE/wp-json/wp/v2/posts/?_embed&per_page=5&author=1
  4. Execute this JS in console: JSON.parse(document.getElementsByTagName('pre')[0].innerHTML)[0].excerpt.rendered
    Output should not include html tags for sharing buttons

This issue has been marked as stale. This happened because:

  • It has been inactive in the past 6 months.
  • It hasn’t been labeled `[Pri] Blocker`, `[Pri] High`.

No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.

The bug still exists...

This issue has been marked as stale. This happened because:

  • It has been inactive in the past 6 months.
  • It hasn’t been labeled `[Pri] Blocker`, `[Pri] High`.

No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.

Was this page helpful?
0 / 5 - 0 ratings