Changeset 873
- Timestamp:
- 01/30/07 17:46:07 (2 years ago)
- Files:
-
- trunk/wp-admin/custom-header.php (modified) (1 diff)
- trunk/wp-admin/options-reading.php (modified) (4 diffs)
- trunk/wp-admin/wp-admin.css (modified) (1 diff)
- trunk/wp-includes/capabilities.php (modified) (2 diffs)
- trunk/wp-includes/cron.php (modified) (1 diff)
- trunk/wp-includes/functions.php (modified) (5 diffs)
- trunk/wp-includes/js/interface.js (added)
- trunk/wp-includes/js/jquery-latest.pack.js (added)
- trunk/wp-includes/post.php (modified) (2 diffs)
- trunk/xmlrpc.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-admin/custom-header.php
r830 r873 224 224 if ( $width == HEADER_IMAGE_WIDTH && $height == HEADER_IMAGE_HEIGHT ) { 225 225 set_theme_mod('header_image', $url); 226 $header = apply_filters('wp_create_file_in_uploads', $ header); // For replication226 $header = apply_filters('wp_create_file_in_uploads', $file, $id); // For replication 227 227 return $this->finished(); 228 228 } elseif ( $width > HEADER_IMAGE_WIDTH ) { 229 229 $oitar = $width / HEADER_IMAGE_WIDTH; 230 230 $image = wp_crop_image($file, 0, 0, $width, $height, HEADER_IMAGE_WIDTH, $height / $oitar, false, str_replace(basename($file), 'midsize-'.basename($file), $file)); 231 $image = apply_filters('wp_create_file_in_uploads', $image ); // For replication231 $image = apply_filters('wp_create_file_in_uploads', $image, $id); // For replication 232 232 233 233 $url = str_replace(basename($url), basename($image), $url); trunk/wp-admin/options-reading.php
r810 r873 51 51 </div> 52 52 <?php endif; ?> 53 </fieldset>54 53 </td> 55 54 </tr> … … 65 64 <td> 66 65 <input name="posts_per_page" type="text" id="posts_per_page" value="<?php form_option('posts_per_page'); ?>" size="3" /> <?php _e('posts') ?> 67 </select>68 66 </td> 69 67 </tr> … … 83 81 <p><label><input name="rss_use_excerpt" type="radio" value="0" <?php checked(0, get_option('rss_use_excerpt')); ?> /> <?php _e('Full text') ?></label><br /> 84 82 <label><input name="rss_use_excerpt" type="radio" value="1" <?php checked(1, get_option('rss_use_excerpt')); ?> /> <?php _e('Summary') ?></label></p> 85 <p><?php _e('Note: If you use the <code>< --more--></code> feature, it will cut off posts in RSS feeds.'); ?></p>83 <p><?php _e('Note: If you use the <code><!--more--></code> feature, it will cut off posts in RSS feeds.'); ?></p> 86 84 </td> 87 85 </tr> … … 97 95 <p class="submit"> 98 96 <input type="hidden" name="action" value="update" /> 99 <input type="hidden" name="page_options" value="posts_per_page,posts_per_rss,rss_use_excerpt,blog_charset,gzipcompression,show_on_front,page_on_front,page_for_posts" />100 97 <input type="hidden" name="page_options" value="posts_per_page,posts_per_rss,rss_use_excerpt,blog_charset,show_on_front,page_on_front,page_for_posts" /> 101 98 <input type="submit" name="Submit" value="<?php _e('Update Options »') ?>" /> trunk/wp-admin/wp-admin.css
r865 r873 889 889 letter-spacing: -.05em; 890 890 margin: 0; 891 font-family: Georgia, "Times New Roman", Times, serif 891 font-family: Georgia, "Times New Roman", Times, serif; 892 892 } 893 893 trunk/wp-includes/capabilities.php
r810 r873 56 56 unset($this->role_names[$role]); 57 57 unset($this->roles[$role]); 58 58 59 59 if ( $this->use_db ) 60 60 update_option($this->role_key, $this->roles); … … 428 428 429 429 $author_data = get_userdata($user_id); 430 $page_author_data = get_userdata($p ost->post_author);430 $page_author_data = get_userdata($page->post_author); 431 431 if ($user_id == $page_author_data->ID) 432 432 $caps[] = 'read'; trunk/wp-includes/cron.php
r797 r873 94 94 95 95 function wp_cron() { 96 // Prevent infinite loops caused by lack of wp-cron.php 97 if ( strpos($_SERVER['REQUEST_URI'], '/wp-cron.php') !== false ) 98 return; 99 96 100 $crons = _get_cron_array(); 97 101 trunk/wp-includes/functions.php
r868 r873 204 204 global $wpdb, $switched, $current_blog; 205 205 206 $pre = apply_filters( 'pre_option_' . $setting, false ); 207 if ( $pre ) 208 return $pre; 209 206 210 if ( $switched == false && defined('WP_INSTALLING') == false ) { 207 // prevent non-existent options from triggering multiple queries208 if ( true === wp_cache_get($setting, 'notoptions') )209 return false;210 211 $value = wp_cache_get($setting, 'options'); 211 212 } else { … … 213 214 wp_cache_delete($setting, 'options'); 214 215 } 216 217 // Uncomment if we get any page not found or rewrite errors 218 // if( $setting == 'rewrite_rules' ) 219 // $value = false; 215 220 216 221 if ( $value == 'novalueindb' ) … … 228 233 if( is_object( $row) ) { // Has to be get_row instead of get_var because of funkiness with 0, false, null values 229 234 $value = $row->option_value; 230 wp_cache_set($setting, $value, 'options');231 } else { // option does not exist, so we must cache its non-existence232 wp_cache_set($setting, true, 'notoptions');235 wp_cache_set($setting, ($value=='')?'emptystringindb':$value, 'options'); 236 } else { 237 wp_cache_set($setting, 'novalueindb', 'options'); 233 238 return false; 234 239 } … … 290 295 return true; 291 296 } 292 293 if ( true === wp_cache_get($option_name, 'notoptions') )294 wp_cache_delete($option_name, 'notoptions');295 297 296 298 $_newvalue = $newvalue; … … 1212 1214 $adminurl = get_option('siteurl') . '/wp-admin'; 1213 1215 if ( wp_get_referer() ) 1214 $adminurl = wp_ get_referer();1216 $adminurl = wp_specialchars(wp_get_referer(), 1); 1215 1217 1216 1218 $title = __('WordPress Confirmation'); trunk/wp-includes/post.php
r854 r873 75 75 function get_extended($post) { 76 76 //Match the new style more links 77 if ( preg_match('/<!--more(.+?)?-->/', $post, $matches)) {78 list($main, $extended) = explode($matches[0],$post,2);77 if ( preg_match('/<!--more(.*?)-->/', $post, $matches) ) { 78 list($main, $extended) = explode($matches[0], $post, 2); 79 79 } else { 80 80 $main = $post; … … 83 83 84 84 // Strip leading and trailing whitespace 85 $main = preg_replace('/^[\s]*(.*)[\s]*$/', '\\1',$main);86 $extended = preg_replace('/^[\s]*(.*)[\s]*$/', '\\1',$extended);85 $main = preg_replace('/^[\s]*(.*)[\s]*$/', '\\1', $main); 86 $extended = preg_replace('/^[\s]*(.*)[\s]*$/', '\\1', $extended); 87 87 88 88 return array('main' => $main, 'extended' => $extended); trunk/xmlrpc.php
r868 r873 23 23 <homePageLink><?php bloginfo_rss('url') ?></homePageLink> 24 24 <apis> 25 <api name="WordPress" blogID="1" preferred="false" apiLink="<?php bloginfo_rss('url') ?>/xmlrpc.php" /> 25 26 <api name="Movable Type" blogID="1" preferred="true" apiLink="<?php bloginfo_rss('url') ?>/xmlrpc.php" /> 26 27 <api name="MetaWeblog" blogID="1" preferred="false" apiLink="<?php bloginfo_rss('url') ?>/xmlrpc.php" /> … … 184 185 $link = post_permalink($page->ID); 185 186 187 // Get info the page parent if there is one. 188 $parent_title = ""; 189 if(!empty($page->post_parent)) { 190 $parent = get_page($page->post_parent); 191 $parent_title = $parent->post_title; 192 } 193 186 194 // Determine comment and ping settings. 187 195 $allow_comments = ("open" == $page->comment_status) ? 1 : 0; … … 197 205 } 198 206 199 // Get the users nicename.200 $ nicename = get_profile("user_nicename", $username);207 // Get the author info. 208 $author = get_userdata($page->post_author); 201 209 202 210 $page_struct = array( 203 "dateCreated" => new IXR_Date($page_date), 204 "userid" => $page->post_author, 205 "page_id" => $page->ID, 206 "page_status" => $page->post_status, 207 "description" => $full_page["main"], 208 "title" => $page->post_title, 209 "link" => $link, 210 "permaLink" => $link, 211 "categories" => $categories, 212 "excerpt" => $page->post_excerpt, 213 "text_more" => $full_page["extended"], 214 "mt_allow_comments" => $allow_comments, 215 "mt_allow_pings" => $allow_pings, 216 "wp_slug" => $page->post_name, 217 "wp_password" => $page->post_password, 218 "wp_author" => $nicename, 219 "wp_page_parent_id" => $page->post_parent, 220 "wp_page_order" => $page->menu_order 211 "dateCreated" => new IXR_Date($page_date), 212 "userid" => $page->post_author, 213 "page_id" => $page->ID, 214 "page_status" => $page->post_status, 215 "description" => $full_page["main"], 216 "title" => $page->post_title, 217 "link" => $link, 218 "permaLink" => $link, 219 "categories" => $categories, 220 "excerpt" => $page->post_excerpt, 221 "text_more" => $full_page["extended"], 222 "mt_allow_comments" => $allow_comments, 223 "mt_allow_pings" => $allow_pings, 224 "wp_slug" => $page->post_name, 225 "wp_password" => $page->post_password, 226 "wp_author" => $author->user_nicename, 227 "wp_page_parent_id" => $page->post_parent, 228 "wp_page_parent_title" => $parent_title, 229 "wp_page_order" => $page->menu_order, 230 "wp_author_username" => $author->user_login 221 231 ); 222 232 … … 409 419 $page_list = $wpdb->get_results(" 410 420 SELECT ID page_id, 411 post_title page_title 421 post_title page_title, 422 post_parent page_parent_id 412 423 FROM {$wpdb->posts} 413 424 WHERE post_type = 'page' … … 1075 1086 } 1076 1087 1077 // Only s tethe menu_order if it was given.1088 // Only set the menu_order if it was given. 1078 1089 if(!empty($content_struct["wp_page_order"])) { 1079 1090 $menu_order = $content_struct["wp_page_order"]; 1091 } 1092 1093 // Only set the post_author if one is set. 1094 if(!empty($content_struct["wp_author"])) { 1095 $post_author = $content_struct["wp_author"]; 1080 1096 } 1081 1097 … … 1122 1138 1123 1139 // We've got all the data -- post it: 1124 $newpost = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'post_date', 'post_date_gmt', 'to_ping', 'post_name', 'post_password', 'post_parent', 'menu_order' );1140 $newpost = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'post_date', 'post_date_gmt', 'to_ping', 'post_name', 'post_password', 'post_parent', 'menu_order', 'post_author'); 1125 1141 1126 1142 $result = wp_update_post($newpost); … … 1165 1181 $post = get_extended($postdata['post_content']); 1166 1182 $link = post_permalink($postdata['ID']); 1183 1184 // Get the author info. 1185 $author = get_userdata($postdata['post_author']); 1167 1186 1168 1187 $allow_comments = ('open' == $postdata['comment_status']) ? 1 : 0; … … 1183 1202 'mt_text_more' => $post['extended'], 1184 1203 'mt_allow_comments' => $allow_comments, 1185 'mt_allow_pings' => $allow_pings 1204 'mt_allow_pings' => $allow_pings, 1205 'wp_slug' => $postdata['post_name'], 1206 'wp_password' => $postdata['post_password'], 1207 'wp_author' => $author->user_nicename, 1208 'wp_author_username' => $author->user_login 1186 1209 ); 1187 1210 … … 1225 1248 $post = get_extended($entry['post_content']); 1226 1249 $link = post_permalink($entry['ID']); 1250 1251 // Get the post author info. 1252 $author = get_userdata($entry['ID']); 1227 1253 1228 1254 $allow_comments = ('open' == $entry['comment_status']) ? 1 : 0; … … 1243 1269 'mt_text_more' => $post['extended'], 1244 1270 'mt_allow_comments' => $allow_comments, 1245 'mt_allow_pings' => $allow_pings 1271 'mt_allow_pings' => $allow_pings, 1272 'wp_slug' => $entry['post_name'], 1273 'wp_password' => $entry['post_password'], 1274 'wp_author' => $author->user_nicename, 1275 'wp_author_username' => $author->user_login 1246 1276 ); 1247 1277 … … 1275 1305 1276 1306 // FIXME: can we avoid using direct SQL there? 1277 if ($cats = $wpdb->get_results("SELECT cat_ID,cat_name FROM $wpdb->categories", ARRAY_A)) {1307 if ($cats = $wpdb->get_results("SELECT cat_ID,cat_name,category_parent FROM $wpdb->categories", ARRAY_A)) { 1278 1308 foreach ($cats as $cat) { 1279 1309 $struct['categoryId'] = $cat['cat_ID']; 1310 $struct['parentId'] = $cat['category_parent']; 1280 1311 $struct['description'] = $cat['cat_name']; 1281 1312 $struct['categoryName'] = $cat['cat_name'];
