Changeset 1864961
- Timestamp:
- 04/26/2018 05:52:37 PM (8 years ago)
- Location:
- pushnews/trunk
- Files:
-
- 4 edited
-
CHANGELOG.md (modified) (1 diff)
-
class.pushnews.php (modified) (3 diffs)
-
pushnews.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
pushnews/trunk/CHANGELOG.md
r1847196 r1864961 1 1 CHANGELOG 2 2 ========= 3 # 1.5.2 4 - Fixed some issues regarding scheduled posts 5 3 6 # 1.5.1 4 7 - Fixed some issues regarding the automatic push notifications -
pushnews/trunk/class.pushnews.php
r1847196 r1864961 23 23 24 24 class Pushnews { 25 const VERSION = '1.5. 1';25 const VERSION = '1.5.2'; 26 26 const RESOURCES_VERSION = '1'; 27 27 const API_URL = 'https://app.pushnews.eu/api.php/v1'; … … 89 89 } 90 90 91 function publish_post_custom_hook($post_id, $post) 92 { 93 $sendNotification = $_POST['pushnews_send_notification']; 94 $sendEmail = $_POST['pushnews_send_email']; 91 public function future_post_custom_hook($post_id) { 92 $sendNotification = $_POST['pushnews_send_notification']; 93 $sendEmail = $_POST['pushnews_send_email']; 94 95 if($sendNotification) { 96 update_post_meta( 97 $post_id, 98 'sendNotification', 99 $sendNotification 100 ); 101 } 102 103 if($sendEmail) { 104 update_post_meta( 105 $post_id, 106 'sendEmail', 107 $sendEmail 108 ); 109 } 110 } 111 112 function publish_post_custom_hook($post_id, $post) { 113 $sendNotification = $_POST['pushnews_send_notification'] || get_post_meta($post_id, 'sendNotification'); 114 $sendEmail = $_POST['pushnews_send_email'] || get_post_meta($post_id, 'sendEmail'); 95 115 $options = get_option( 'pushnews_options' ); 96 116 97 if( $post->post_date == $post->post_modified &&isset($options['auth_token']) && $options['auth_token'] != "") {117 if(isset($options['auth_token']) && $options['auth_token'] != "") { 98 118 $notification = array( 99 119 "message" => array( 100 120 "title" => get_the_title($post), 101 "body" => substr( get_post_field('post_content', $post_id), 0, 400) . ' ...' ,121 "body" => substr(strip_tags(get_post_field('post_content', $post_id)), 0, 300) . ' ...' , 102 122 "url" => get_permalink($post), 103 123 ) … … 109 129 } 110 130 111 wp_remote_post("https://api.pushnews.eu/v2/push/" . $options['app_id'], array(131 wp_remote_post("https://api.pushnews.eu/v2/push/" . $options['app_id'], array( 112 132 "body" => json_encode($notification), 113 133 "headers" => array( -
pushnews/trunk/pushnews.php
r1847196 r1864961 6 6 * Plugin URI: https://www.pushnews.eu/ 7 7 * Description: Send Web Push Notifications to your visitors. Increase your website traffic - Simple and fast UI - Automate push notifications via Facebook Page integration. 8 * Version: 1.5. 18 * Version: 1.5.2 9 9 * Author URI: https://www.pushnews.eu/ 10 10 * License: GPLv2 or later … … 29 29 */ 30 30 31 define( 'PUSHNEWS_VERSION', '1.5. 1' );31 define( 'PUSHNEWS_VERSION', '1.5.2' ); 32 32 define( 'PUSHNEWS__PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 33 33 … … 48 48 // Send push on post publish 49 49 add_action( "add_meta_boxes", array( 'Pushnews', "add_custom_meta_box" )); 50 add_action( 'future_post', array('Pushnews', 'future_post_custom_hook' ), 10, 1); 50 51 add_action( "publish_post", array('Pushnews', 'publish_post_custom_hook' ), 10, 2 ); -
pushnews/trunk/readme.txt
r1847196 r1864961 60 60 61 61 == Changelog == 62 = 1.5.2 = 63 * Fixed some issues regarding scheduled posts 64 62 65 = 1.5.1 = 63 66 * Fixed some issues regarding the automatic push notifications
Note: See TracChangeset
for help on using the changeset viewer.