Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: enable autoshare meta always set to 0 when saving draft #103

Merged
merged 2 commits into from
Jul 1, 2020

Conversation

dinhtungdu
Copy link
Contributor

Description of the Change

In block editor and with Yoast activated, there is an additional call that triggers save_post action, which then triggers TenUp\AutoshareForTwitter\Core\Post_Meta\save_tweet_meta. This time the REST_REQUEST constant isn't defined, which leads to the post meta autoshare_autoshare_for_twitter is always set to 0. This PR checks for the 'Enable by default' setting and use that value to update the post meta.

Fixes #102

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

@jeffpaul jeffpaul requested a review from rickalee June 26, 2020 13:47
@jeffpaul jeffpaul added this to the 1.1.0 milestone Jun 26, 2020
@jeffpaul
Copy link
Member

@dinhtungdu FYI, looks like there are failing tests in PHP 7.1

@jeffpaul
Copy link
Member

Otherwise confirmed internally that this resolves the reported issue, so we'll be good to merge once we can get the tests passing.

@jeffpaul jeffpaul mentioned this pull request Jun 30, 2020
18 tasks
@dinhtungdu
Copy link
Contributor Author

@jeffpaul Tests are updated and passed now

@jeffpaul jeffpaul merged commit 97c0fb6 into develop Jul 1, 2020
@jeffpaul jeffpaul deleted the fix/102 branch July 2, 2020 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autoshare Enabled by default and Drafts
2 participants