Created
February 3, 2019 17:50
-
-
Save aikusuma/5bb711358c31d7812f6aa3b1ea331b49 to your computer and use it in GitHub Desktop.
Adding Onesignal To Functions.php WordPress
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
add_filter('onesignal_send_notification', 'onesignal_send_notification_filter', 10, 4); | |
function onesignal_send_notification_filter($fields, | |
$new_status, $old_status, $post) { | |
$fields['data'] = array( | |
"id" => $post->ID, | |
"category" => "pemberitahuan", | |
"silent" => false, | |
); | |
$fields['isAndroid'] = true; | |
return $fields; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment