| @@ -93,24 +93,27 @@ | ||
| 93 | 93 | { |
| 94 | 94 | global $post; |
| 95 | 95 | $messages[ HURRYT_POST_TYPE ] = array( |
| 96 | 96 | 0 => '', |
| 97 | - 1 => __( 'Campaign updated.', 'hurrytimer' ), | |
| 97 | + 1 => __( 'Campaign updated', "hurrytimer" ), | |
| 98 | 98 | 2 => '', |
| 99 | 99 | 3 => '', |
| 100 | - 4 => __( 'Campaign updated.', 'hurrytimer' ), | |
| 100 | + 4 => __( 'Campaign updated.', "hurrytimer" ), | |
| 101 | 101 | 5 => '', |
| 102 | - 6 => __( 'Campaign published.', 'hurrytimer' ), | |
| 103 | - 7 => __( 'Campaign saved.', 'hurrytimer' ), | |
| 104 | - 8 => __( 'Campaign submitted.', 'hurrytimer' ), | |
| 102 | + 6 => __( 'Campaign published', "hurrytimer" ), | |
| 103 | + 7 => __( 'Campaign saved.', "hurrytimer" ), | |
| 104 | + 8 => __( 'Campaign submitted.', "hurrytimer" ), | |
| 105 | 105 | 9 => sprintf( |
| 106 | 106 | __( |
| 107 | 107 | 'Campaign scheduled for: <strong>%1$s</strong>.', |
| 108 | - 'hurrytimer' | |
| 108 | + "hurrytimer" | |
| 109 | 109 | ), |
| 110 | - date_i18n(__( 'M j, Y @ G:i', 'hurrytimer' ),strtotime( $post->post_date )) | |
| 110 | + date_i18n( | |
| 111 | + __( 'M j, Y @ G:i', "hurrytimer" ), | |
| 112 | + strtotime( $post->post_date ) | |
| 113 | + ) | |
| 111 | 114 | ), |
| 112 | - 10 => __( 'Campaign draft updated.', 'hurrytimer' ), | |
| 115 | + 10 => __( 'Campaign draft updated.', "hurrytimer" ), | |
| 113 | 116 | ); |
| 114 | 117 | |
| 115 | 118 | return $messages; |
| 116 | 119 | } |
| @@ -196,16 +199,14 @@ | ||
| 196 | 199 | */ |
| 197 | 200 | |
| 198 | 201 | public function save_settings( $post_id ) |
| 199 | 202 | { |
| 200 | - if ((defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) | |
| 201 | - || (!isset($_POST['post_ID']) || $post_id != $_POST['post_ID']) | |
| 202 | - || (!current_user_can('edit_post', $post_id)) | |
| 203 | - | |
| 204 | - ) { | |
| 203 | + if ( wp_is_post_revision( $post_id ) ) { | |
| 205 | 204 | return; |
| 206 | 205 | } |
| 207 | - | |
| 206 | + if ( !current_user_can( 'edit_post', $post_id ) ) { | |
| 207 | + return; | |
| 208 | + } | |
| 208 | 209 | $countdown = new Campaign( $post_id ); |
| 209 | 210 | $countdown->storeSettings( $_POST ); |
| 210 | 211 | } |
| 211 | 212 | |