-
Notifications
You must be signed in to change notification settings - Fork 156
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 and update "keep original publish date" snippet in the docs #1160
Conversation
Updating the docs for the publication date snippet. The argument expected by the core API is `date` and not `post_date`. Also adding `date_gmt` for completion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch but I think it's a little more complicated.
The same filter is used for both internal connections (via wp_insert_post
) and external connections (via the REST API).
The forth parameter sent to the filter is the connection, so the code snippet probably needs to be conditional with an is_a()
check for whether it's an internal or external push connection.
The pull post snippet looks good.
Update snippet to account for the two types of connections
Thanks for the clarification @peterwilsoncc , fixed the snippet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @leogermani
This looks good to me, I've added a bit of a nitpick. I'll commit that and merge the PR.
Updating the docs for the publication date snippet.
date
and notpost_date
. Also addingdate_gmt
for completionDescription of the Change
Fixes one of the snippets in the docs
How to test the Change
Credits
Props @leogermani
Checklist: