Created
January 10, 2017 18:21
-
-
Save scottopolis/4a1c4e660f763151a76c9e2b508970ae to your computer and use it in GitHub Desktop.
Send Custom Reactor Notification
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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