Skip to content

Allow autotweeting of scheduled posts.#399

Merged
dkotter merged 1 commit into
developfrom
fix/398-scheduled-posts
Feb 2, 2026
Merged

Allow autotweeting of scheduled posts.#399
dkotter merged 1 commit into
developfrom
fix/398-scheduled-posts

Conversation

@peterwilsoncc

@peterwilsoncc peterwilsoncc commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

Description of the Change

Removes the current_user_can() check in the publish_tweet() function to account for cron jobs publishing a scheduled post.

The save_tweet_meta() function includes a current_user_can check so the data should not be manipulated by unauthorized users in the classic editor. The rest API endpoint uses the update_post_autoshare_for_twitter_meta_permission_check() function to implement the current_user_can() check.

I wasn't able to figure out how to test this without doing a large refactor of test_maybe_publish_tweet().

Closes #398

How to test the Change

  1. Create a block editor post
  2. Enable auto-tweet and an account to tweet from
  3. Schedule the post for three minutes for now
  4. Return to the All posts screen
  5. Make a cup of tea or coffee stating from stone cold water in the kettle
  6. Once the scheduled time has past, load a random screen in the WP Dashboard in order to trigger WP-Cron
  7. Ensure the tweet is published
  8. Enable the classic editor
  9. Create a classic editor post
  10. Enable auto-tweet and an account to tweet from
  11. Schedule the post for three minutes for now
  12. Return to the all posts screen
  13. Pat the cat/dog for a few minutes explaining what a good cat/dog they are throughout
  14. Once the scheduled time has past, load a random screen in the WP Dashboard in order to trigger WP-Cron
  15. Ensure the tweet is published

Changelog Entry

Fixed - Bug preventing the autosharing of posts for scheduled posts.

Credits

Props @justinmaurerdotdev, @peterwilsoncc

Checklist:

@github-actions github-actions Bot added this to the 2.4.0 milestone Feb 2, 2026
@peterwilsoncc peterwilsoncc marked this pull request as ready for review February 2, 2026 02:34
@github-actions github-actions Bot added the needs:feedback This requires reporter feedback to better understand the request. label Feb 2, 2026
@github-actions

This comment was marked as outdated.

@peterwilsoncc peterwilsoncc changed the title All autotweeting of scheduled posts. Allow autotweeting of scheduled posts. Feb 2, 2026
@github-actions github-actions Bot added needs:code-review This requires code review. and removed needs:feedback This requires reporter feedback to better understand the request. labels Feb 2, 2026
@dkotter dkotter merged commit 4204cb1 into develop Feb 2, 2026
16 of 19 checks passed
@dkotter dkotter deleted the fix/398-scheduled-posts branch February 2, 2026 15:35
@dkotter dkotter modified the milestones: 2.4.0, 2.3.3 Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:code-review This requires code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bad security patch. Scheduled posts no longer autotweet.

2 participants