Ticket #2346: no-newlines.diff
| File no-newlines.diff, 5.4 KB (added by , 20 years ago) |
|---|
-
wp-admin/admin-functions.php
288 288 $post->post_status = 'draft'; 289 289 $post->comment_status = get_settings('default_comment_status'); 290 290 $post->ping_status = get_settings('default_ping_status'); 291 $post->convert_newlines = 'open'; 291 292 $post->post_pingback = get_settings('default_pingback_flag'); 292 293 $post->post_category = get_settings('default_category'); 293 294 $post->post_content = apply_filters('default_content', $post_content); -
wp-admin/edit-page-form.php
44 44 45 45 <div id="moremeta"> 46 46 <div id="grabit" class="dbx-group"> 47 48 <fieldset id="newlinesdiv" class="dbx-box"> 49 <h3 class="dbx-handle"><?php _e('Convert Newlines') ?></h3> 50 <div class="dbx-content"><input name="convert_newlines" type="checkbox" id="convert_newlines" value="open" <?php checked($post->convert_newlines, 'open'); ?> /></div> 51 </fieldset> 52 47 53 <fieldset id="commentstatusdiv" class="dbx-box"> 48 54 <h3 class="dbx-handle"><?php _e('Discussion') ?></h3> 49 55 <div class="dbx-content"> … … 55 61 </div> 56 62 </fieldset> 57 63 64 58 65 <fieldset id="passworddiv" class="dbx-box"> 59 66 <h3 class="dbx-handle"><?php _e('Password-Protect Post') ?></h3> 60 67 <div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo $post->post_password ?>" /></div> -
wp-includes/functions-post.php
31 31 $post_name = apply_filters('name_save_pre', $post_name); 32 32 $comment_status = apply_filters('comment_status_pre', $comment_status); 33 33 $ping_status = apply_filters('ping_status_pre', $ping_status); 34 $convert_newlines= apply_filters('convert_newlines', $convert_newlines); 34 35 35 36 // Make sure we set a valid category 36 37 if (0 == count($post_category) || !is_array($post_category)) { … … 80 81 if ( empty($post_pingback) ) 81 82 $post_pingback = get_option('default_pingback_flag'); 82 83 84 if ( empty($convert_newlines) ) 85 $convert_newlines = 'closed'; 86 83 87 if ( isset($to_ping) ) 84 88 $to_ping = preg_replace('|\s+|', "\n", $to_ping); 85 89 else … … 139 143 post_modified = '".current_time('mysql')."', 140 144 post_modified_gmt = '".current_time('mysql',1)."', 141 145 post_parent = '$post_parent', 142 menu_order = '$menu_order' 146 menu_order = '$menu_order', 147 convert_newlines = '$convert_newlines' 143 148 WHERE ID = $post_ID"); 144 149 } else { 145 150 $wpdb->query( 146 151 "INSERT IGNORE INTO $wpdb->posts 147 (post_author, post_date, post_date_gmt, post_content, post_content_filtered, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping, pinged, post_modified, post_modified_gmt, post_parent, menu_order, post_mime_type )152 (post_author, post_date, post_date_gmt, post_content, post_content_filtered, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping, pinged, post_modified, post_modified_gmt, post_parent, menu_order, post_mime_type, convert_newlines) 148 153 VALUES 149 ('$post_author', '$post_date', '$post_date_gmt', '$post_content', '$post_content_filtered', '$post_title', '$post_excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$to_ping', '$pinged', '$post_date', '$post_date_gmt', '$post_parent', '$menu_order', '$post_mime_type' )");154 ('$post_author', '$post_date', '$post_date_gmt', '$post_content', '$post_content_filtered', '$post_title', '$post_excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$to_ping', '$pinged', '$post_date', '$post_date_gmt', '$post_parent', '$menu_order', '$post_mime_type', '$convert_newlines')"); 150 155 $post_ID = $wpdb->insert_id; 151 156 } 152 157 -
wp-includes/functions.php
1183 1183 if ( !isset($wp_filter[$tag]) ) { 1184 1184 return $string; 1185 1185 } 1186 1186 1187 foreach ($wp_filter[$tag] as $priority => $functions) { 1187 1188 if ( !is_null($functions) ) { 1188 1189 foreach($functions as $function) { -
wp-includes/template-functions-post.php
63 63 global $id, $post, $more, $single, $withcomments, $page, $pages, $multipage, $numpages; 64 64 global $preview; 65 65 global $pagenow; 66 global $wp_filter; 66 67 $output = ''; 67 68 68 69 if ( !empty($post->post_password) ) { // if there's a password … … 77 78 else 78 79 $file = $pagenow; //$_SERVER['PHP_SELF']; 79 80 81 if ( 'closed' == $post->convert_newlines ) 82 { 83 // FIXME: Is wpautop important? I notice it does more than just newlines. Is that a problem? 84 remove_filter('the_content', 'wpautop'); 85 } 86 80 87 $content = $pages[$page-1]; 81 88 $content = explode('<!--more-->', $content, 2); 82 89 if ( (preg_match('/<!--noteaser-->/', $post->post_content) && ((!$multipage) || ($page==1))) )