Ticket #25551: wp-mail.diff
File wp-mail.diff, 1.8 KB (added by , 12 years ago) |
---|
-
C:/Users/GT/
old new 10 10 /** Make sure that the WordPress bootstrap has run before continuing. */ 11 11 require(dirname(__FILE__) . '/wp-load.php'); 12 12 13 /** Check to see if post by email is set to enabled. 14 * @since 1.2.1 15 */ 13 16 if ( ! apply_filters( 'enable_post_by_email_configuration', true ) ) 14 17 wp_die( __( 'This action has been disabled by the administrator.' ) ); 15 18 … … for ( $i = 1; $i <= $count; $i++ ) { 192 195 $content = empty( $content[1] ) ? $content[0] : $content[1]; 193 196 194 197 $content = trim($content); 195 198 /** Applied to the content of a post submitted by email, before saving. 199 * @since 1.2.1 200 */ 196 201 $post_content = apply_filters('phone_content', $content); 197 202 198 203 $post_title = xmlrpc_getposttitle($content); … … for ( $i = 1; $i <= $count; $i++ ) { 202 207 $post_category = array(get_option('default_email_category')); 203 208 204 209 $post_data = compact('post_content','post_title','post_date','post_date_gmt','post_author','post_category', 'post_status'); 205 $post_data = add_magic_quotes($post_data);210 $post_data = wp_slash($post_data); 206 211 207 212 $post_ID = wp_insert_post($post_data); 208 213 if ( is_wp_error( $post_ID ) ) … … for ( $i = 1; $i <= $count; $i++ ) { 211 216 // We couldn't post, for whatever reason. Better move forward to the next email. 212 217 if ( empty( $post_ID ) ) 213 218 continue; 214 219 /**Runs just after a post is added via email. 220 * @since1.2.1 221 * @param type $var post ID. 222 * 223 */ 215 224 do_action('publish_phone', $post_ID); 216 225 217 226 echo "\n<p>" . sprintf(__('<strong>Author:</strong> %s'), esc_html($post_author)) . '</p>';