ThRintelen / wp-ionic-user-push

GNU General Public License v2.0
0 stars 0 forks source link

Ionic Push Notification when New post published #1

Closed ArbouchiAyoub closed 8 years ago

ArbouchiAyoub commented 8 years ago

Hi Friends,

i add some codes to make this plugin push notifications when new post has ben published

So at the class named ionic-iup-send-push.php the following codes :

Function for post update :

function push_update_notification($new_status, $old_status, $post) { if ($old_status == 'publish' && $new_status == 'publish' && 'post' == get_post_type($post)) { $post_title = get_the_title($post); $post_url = get_permalink($post);
$post_id = get_the_ID($post); $post_author = get_the_author_meta('display_name', $post->post_author); $message = $post_title . ";" . $post_url . ";". $post_id . ";" . $post_author . ";";

        $userIds = Ionic_User_UserId_Manager::get_all_userIds();
        $options= load_options();
        // Send notification
        $up = "update";
        send_push_notifications($message, $userIds, $options);
    }

}

And on the class named class-iup i added the action below : on the function named plugin-activation i write this code: add_action('transition_post_status', 'push_update_notification',2,3);

and i can't get any notification where is the probleme please.

Regards :)

ThRintelen commented 8 years ago

Thanks for the code. I checkt it and implement it into the plugin. Please be patient.

ThRintelen commented 8 years ago

I have push the new code here. Can you download the plugin from github and test it in your installation? Let me know if it works fine, so i can update the plugin in at wordpress.org.

Please see the new settings in "basic settings" of the plugin.

ArbouchiAyoub commented 8 years ago

Yes absolutely work Fine :-) i've already done this ;) Regards

2015-12-20 10:50 GMT+00:00 Thorsten Rintelen notifications@github.com:

I have push the new code here. Can you download the plugin from github and test it in your installation? Let me know if it works fine, so i can update the plugin in at wordpress.org.

Please see the new settings in "basic settings" of the plugin.

— Reply to this email directly or view it on GitHub https://github.com/rintynator/wp-ionic-user-push/issues/1#issuecomment-166109687 .