Skip to content

Instantly share code, notes, and snippets.

@scottopolis
Created January 10, 2017 18:21
Show Gist options
  • Select an option

  • Save scottopolis/4a1c4e660f763151a76c9e2b508970ae to your computer and use it in GitHub Desktop.

Select an option

Save scottopolis/4a1c4e660f763151a76c9e2b508970ae to your computer and use it in GitHub Desktop.
Send Custom Reactor Notification
<?php
// This code would go in a custom plugin or theme functions.php file
add_action( 'publish_post', 'send_my_push', 10, 2 );
function send_my_push( $post_id, $post ) {
// Put conditions here to only send notification for the posts you want
if( $post->post_author != 'Scott' )
return;
$reactor_push_cpt = new Reactor_Notifications_CPT();
$reactor_push_cpt->send_push_notification( $post_id, $post );
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment