distributor icon indicating copy to clipboard operation
distributor copied to clipboard

adds dt_should_push_network_post action

Open psorensen opened this issue 2 months ago • 1 comments

Description of the Change

Adds filter to short circuit distribution.

How to test the Change

Simple example code to test filter.

/**
 * Test 
 *
 * @param bool    $should_push Whether the post should be pushed.
 * @param WP_Post $post        The post object.
 * @return bool Whether the post should be pushed.
 */
function test_prevent_push( $should_push, $post ) {
	if ( $post->ID === 1 ) {
            $should_push = false;
        }

	return $should_push;
}
add_filter( 'dt_should_push_network_post',    __NAMESPACE__ . '\\test_prevent_push', 10, 4 );

Changelog Entry

Added filters to prevent external and internal pushes.

Credits

Props @psorensen

Checklist:

psorensen avatar Dec 11 '25 17:12 psorensen

@psorensen thanks for the PR! Could you please fill out the PR template with description, changelog, and credits information so that we can properly review and merge this?

github-actions[bot] avatar Dec 11 '25 17:12 github-actions[bot]