Plugin Directory

Changeset 948542


Ignore:
Timestamp:
07/15/2014 05:59:47 AM (12 years ago)
Author:
pushwoosh
Message:

Version 2.3.6

Location:
push-notifications/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • push-notifications/trunk/pushwoosh.php

    r942866 r948542  
    33    /**
    44     * @package Pushwoosh
    5      * @version 2.3.5
     5     * @version 2.3.6
    66     */
    77
     
    1212    * Author: Arello Mobile
    1313    * Author URI: http://www.arello-mobile.com/
    14     * Version: 2.3.5
    15     *
    16     * Copyright 2013 Arello Mobile (email: support@arello-mobile.com)
     14    * Version: 2.3.6
     15    *
     16    * Copyright 2014 Arello Mobile (email: support@arello-mobile.com)
    1717    * This program is free software; you can redistribute it and/or modify
    1818    * it under the terms of the GNU General Public License as published by
     
    5555    // do not use http://codex.wordpress.org/Plugin_API/Action_Reference/save_post
    5656    // it can produce twice push send(if another plugins installed)
    57     add_action('publish_post', 'pushwoosh_save_post');
     57    add_action('publish_post', 'pushwoosh_publish_post');
     58    add_action('transition_post_status', 'pushwoosh_save_post');
    5859
    5960    function pushwoosh_message_box($post) {
     
    119120    }
    120121
    121     function pushwoosh_save_post($post_id) {
     122    function pushwoosh_save_post($newStatus, $oldStatus = null, $post = null) {
     123        if (!$post)
     124            return;
     125        /*
     126         * if update many posts, don't send push
     127         */
     128        if (array_key_exists('post_status', $_GET) && $_GET['post_status']=='all') {
     129            return;
     130        }
     131
     132        if (!empty($_POST)) {
     133            if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
     134                return;
     135            }
     136
     137            if (!isset($_POST['pushwoosh_post_nonce'])) {
     138                return;
     139            }
     140            if (!wp_verify_nonce($_POST['pushwoosh_post_nonce'], plugin_basename( __FILE__ ))) {
     141                return;
     142            }
     143            if (array_key_exists('safari_title', $_POST)) {
     144                $options['safari_title'] = $_POST['safari_title'];
     145            } else {
     146                $options['safari_title'] = '';
     147            }
     148            if (array_key_exists('pushwoosh_message_content', $_POST)) {
     149                $message_content = $_POST['pushwoosh_message_content'];
     150            }
     151            update_post_meta($post->ID, 'pushwoosh_message_content', $message_content);
     152            update_post_meta($post->ID, 'safari_title', $options['safari_title']);
     153        }
     154    }
     155
     156    function pushwoosh_publish_post($post_id) {
    122157
    123158        /*
  • push-notifications/trunk/readme.txt

    r942868 r948542  
    4141* Fixed bug with twice push
    4242
     43= 2.3.6 =
     44* Saving push notification data in widget for draft post
     45
    4346== Installation ==
    44471. Download the Pushwoosh plugin.
  • push-notifications/trunk/settings.php

    r874622 r948542  
    1414    public $sections = array(
    1515        'application_access' => array(
     16            'title' => 'Settings',
    1617            'description' => 'Please configure the following settings below.',
    1718            'fields' => array(
Note: See TracChangeset for help on using the changeset viewer.