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

Expose last X headers for extensability #353

Merged
merged 3 commits into from
Dec 16, 2024

Conversation

s3rgiosan
Copy link
Member

@s3rgiosan s3rgiosan commented Dec 16, 2024

I'm developing an add-on plugin for the Autopost for X plugin that shows X API usage statistics in the WordPress admin for a client. Since there's no dedicated endpoint to retrieve these stats, I'll rely on the headers returned by the API when a tweet is posted. By hooking into the autoshare_for_twitter_after_status_update action, I can access these headers and extract key information, such as the current rate limit and reset time.

How to test the Change

Changelog Entry

Added - Last X headers to autoshare_for_twitter_after_status_update hook.

Credits

Props @s3rgiosan

Checklist:

Copy link
Member

@iamdharmesh iamdharmesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks @s3rgiosan

@iamdharmesh iamdharmesh added this to the Future Release milestone Dec 16, 2024
@iamdharmesh iamdharmesh merged commit 9c98b46 into 10up:develop Dec 16, 2024
11 of 12 checks passed
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.

2 participants