Make WordPress Core

Ticket #25551: wp-mail.diff

File wp-mail.diff, 1.8 KB (added by radices, 12 years ago)
  • C:/Users/GT/

    old new  
    1010/** Make sure that the WordPress bootstrap has run before continuing. */
    1111require(dirname(__FILE__) . '/wp-load.php');
    1212
     13/** Check to see if post by email is set to enabled.
     14 * @since 1.2.1
     15 */
    1316if ( ! apply_filters( 'enable_post_by_email_configuration', true ) )
    1417        wp_die( __( 'This action has been disabled by the administrator.' ) );
    1518
    for ( $i = 1; $i <= $count; $i++ ) { 
    192195        $content = empty( $content[1] ) ? $content[0] : $content[1];
    193196
    194197        $content = trim($content);
    195 
     198        /** Applied to the content of a post submitted by email, before saving.
     199         * @since 1.2.1
     200         */
    196201        $post_content = apply_filters('phone_content', $content);
    197202
    198203        $post_title = xmlrpc_getposttitle($content);
    for ( $i = 1; $i <= $count; $i++ ) { 
    202207        $post_category = array(get_option('default_email_category'));
    203208
    204209        $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);
    206211
    207212        $post_ID = wp_insert_post($post_data);
    208213        if ( is_wp_error( $post_ID ) )
    for ( $i = 1; $i <= $count; $i++ ) { 
    211216        // We couldn't post, for whatever reason. Better move forward to the next email.
    212217        if ( empty( $post_ID ) )
    213218                continue;
    214 
     219        /**Runs just after a post is added via email.
     220         * @since1.2.1
     221         * @param type $var post ID.
     222         *
     223         */
    215224        do_action('publish_phone', $post_ID);
    216225
    217226        echo "\n<p>" . sprintf(__('<strong>Author:</strong> %s'), esc_html($post_author)) . '</p>';