Automattic / Automattic/aggregator

Adding More Data to aggregator_post_status Filter

Open
#54 4 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
PHP
Stars
21
Forks
6
PR merge metrics
No merged PRs in 30d

Description

We have a need to push different post statuses contextually dependent upon the original post. I'd like to pass through the entire post data and possibly the original blog ID to be able to find out this information and send a different post status through depending on certain conditions.

**Current Filter**
`apply_filters( 'aggregator_post_status', $orig_post_data['post_status'] );`

However, adding all this extra data feels a little gross, especially when we're already passing through the status. I don't want to change the data passed through now because backwards compatibility but essentially doubling up on post data is also not preferential. #53 could potentially cover our needs but also feels heavy and we would need to update the post again that this filter could have just set.

Any thoughts on changes to this filter @philipjohn?

**For reference, this is the logic we would want to implement:**
We have Categories A and B on posts that could be pushed. If a post assigned to Category A is pushed it should be published right away on the portal (child) site. If a post assigned to Category B is pushed it should be set to draft.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the aggregator_post_status filter and trace the surrounding post-synchronization flow, including how orig_post_data and the current status are passed. Review the existing discussion and determine a backward-compatible filter change that supports category-dependent publish or draft status; done means the approach is agreed and its behavior is covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.