Post

Post published - include private posts

1
add_action( 'notification/trigger/registered', function( $trigger ) {
2
​
3
if ( $trigger->get_slug() !== 'post/post/published' ) {
4
return;
5
}
6
​
7
$trigger->add_action( 'new_to_private', 10 );
8
$trigger->add_action( 'auto-draft_to_private', 10 );
9
$trigger->add_action( 'draft_to_private', 10 );
10
$trigger->add_action( 'pending_to_private', 10 );
11
$trigger->add_action( 'future_to_private', 10 );
12
​
13
} );
Copied!

Post updated - add other post statuses

1
add_filter( 'notification/trigger/wordpress/post/updated/statuses', function( $statuses, $post_type ) {
2
if ( 'my-post-type' === $post_type ) {
3
$statuses[] = 'on-hold';
4
}
5
6
return $statuses;
7
}, 10, 2 );
Copied!
Last modified 11d ago