Automattic / Automattic/syndication
XML Pull Client does not set post_status based on default_post_status
- Dominant language
- PHP
- Stars
- 107
- Forks
- 44
- Avg merge
- 18m
- Merged PRs (30d)
- 19
Description
The XML pull client is publishing posts using the `syn_post_pull_new_post` filter hook. `$this->default_post_status` is never used to set the post status, which means all posts are run through wp_insert_post with no default post_status (therefore the post status is set to 'draft').
This can result in weird behavior (it allows for the post to have no slug, for example, unless one is explicitly passed as part of the `$post` data). Since the post is then published by default using the `wp_publish_post` function (called by `publish_pulled_post` in `class-syndication-wp-xml-client.php`, there is no control over the final post_status of the post (it's always 'publish') unless one removes that filter explicitly.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in class-syndication-wp-xml-client.php and trace the XML pull path from the syn_post_pull_new_post filter through wp_insert_post and publish_pulled_post. Verify how default_post_status is currently ignored; done means pulled posts retain the configured default status instead of always ending as publish, including the existing slug behavior described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100