Changeset 948542
- Timestamp:
- 07/15/2014 05:59:47 AM (12 years ago)
- Location:
- push-notifications/trunk
- Files:
-
- 3 edited
-
pushwoosh.php (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
-
settings.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
push-notifications/trunk/pushwoosh.php
r942866 r948542 3 3 /** 4 4 * @package Pushwoosh 5 * @version 2.3. 55 * @version 2.3.6 6 6 */ 7 7 … … 12 12 * Author: Arello Mobile 13 13 * Author URI: http://www.arello-mobile.com/ 14 * Version: 2.3. 515 * 16 * Copyright 201 3Arello Mobile (email: support@arello-mobile.com)14 * Version: 2.3.6 15 * 16 * Copyright 2014 Arello Mobile (email: support@arello-mobile.com) 17 17 * This program is free software; you can redistribute it and/or modify 18 18 * it under the terms of the GNU General Public License as published by … … 55 55 // do not use http://codex.wordpress.org/Plugin_API/Action_Reference/save_post 56 56 // 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'); 58 59 59 60 function pushwoosh_message_box($post) { … … 119 120 } 120 121 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) { 122 157 123 158 /* -
push-notifications/trunk/readme.txt
r942868 r948542 41 41 * Fixed bug with twice push 42 42 43 = 2.3.6 = 44 * Saving push notification data in widget for draft post 45 43 46 == Installation == 44 47 1. Download the Pushwoosh plugin. -
push-notifications/trunk/settings.php
r874622 r948542 14 14 public $sections = array( 15 15 'application_access' => array( 16 'title' => 'Settings', 16 17 'description' => 'Please configure the following settings below.', 17 18 'fields' => array(
Note: See TracChangeset
for help on using the changeset viewer.