Closed steflp closed 3 years ago
I just change post_type "page" to "post" and filter to the specific ID ($postid) And this code works well ...
@steflp
I'm glad you've managed to get this working! I'm going to go ahead and close this issue. If you have any additional problems with the SDK, feel free to open an issue here explaining the problem and provide reproduction steps if possible.
But perhaps I found ONE solution but i dont find THE solution ! Why When i try with this code '$post->post_type == "page"' your plugin / your hook doesnt work ? And you must not close this topic , sorry ;-( ....
Hello, I want to push notification on specific page ( type_post=> page) . I want to use this code (from documentation) :
`add_filter('onesignal_include_post', 'onesignal_include_post_filter', 10, 3); function onesignal_include_post_filter($new_status, $old_status, $post) {
}`
But It doesnt work !
So I try to use this code but with post :
add_filter('onesignal_include_post', 'onesignal_include_post_filter', 10, 3); function onesignal_include_post_filter($new_status, $old_status, $post) { $postid = get_the_ID(); if ($post->post_type == "post" && ($postid == "15823" || $postid == "15828") && $new_status == "publish") { return true; } }
I just change post_type "page" to "post" and filter to the specific ID ($postid) And this code works well ...