Changeset 29206
- Timestamp:
- 07/17/2014 09:13:53 AM (11 years ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 61 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/admin.php
r28478 r29206 152 152 if ( ! $page_hook = get_plugin_page_hook($plugin_page, $the_parent) ) { 153 153 $page_hook = get_plugin_page_hook($plugin_page, $plugin_page); 154 // backwards compatibility for plugins using add_management_page 154 155 // Backwards compatibility for plugins using add_management_page(). 155 156 if ( empty( $page_hook ) && 'edit.php' == $pagenow && '' != get_plugin_page_hook($plugin_page, 'tools.php') ) { 156 157 // There could be plugin specific params on the URL, so we need the whole query string -
trunk/src/wp-admin/async-upload.php
r28479 r29206 95 95 96 96 if ( $_REQUEST['short'] ) { 97 // short form response - attachment ID only97 // Short form response - attachment ID only. 98 98 echo $id; 99 99 } else { 100 // long form response - big chunk o html100 // Long form response - big chunk o html. 101 101 $type = $_REQUEST['type']; 102 102 -
trunk/src/wp-admin/custom-background.php
r29165 r29206 257 257 if ( get_background_image() ) { 258 258 $background_image_thumb = esc_url( set_url_scheme( get_theme_mod( 'background_image_thumb', str_replace( '%', '%%', get_background_image() ) ) ) ); 259 // background-image URL must be single quote, see below 259 260 // Background-image URL must be single quote, see below. 260 261 $background_styles .= ' background-image: url(\'' . $background_image_thumb . '\');' 261 262 . ' background-repeat: ' . get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) ) . ';' -
trunk/src/wp-admin/custom-header.php
r29165 r29206 935 935 $this->set_header_image( compact( 'url', 'attachment_id', 'width', 'height' ) ); 936 936 937 // cleanup937 // Cleanup. 938 938 $medium = str_replace( basename( $original ), 'midsize-' . basename( $original ), $original ); 939 939 if ( file_exists( $medium ) ) { -
trunk/src/wp-admin/customize.php
r29170 r29206 190 190 do_action( 'customize_controls_print_footer_scripts' ); 191 191 192 // If the frontend and the admin are served from the same domain, load the 193 // preview over ssl if the customizer is being loaded over ssl. This avoids 194 // insecure content warnings. This is not attempted if the admin and frontend 195 // are on different domains to avoid the case where the frontend doesn't have 196 // ssl certs. Domain mapping plugins can allow other urls in these conditions 197 // using the customize_allowed_urls filter. 192 /* 193 * If the frontend and the admin are served from the same domain, load the 194 * preview over ssl if the customizer is being loaded over ssl. This avoids 195 * insecure content warnings. This is not attempted if the admin and frontend 196 * are on different domains to avoid the case where the frontend doesn't have 197 * ssl certs. Domain mapping plugins can allow other urls in these conditions 198 * using the customize_allowed_urls filter. 199 */ 198 200 199 201 $allowed_urls = array( home_url('/') ); -
trunk/src/wp-admin/includes/admin.php
r19772 r29206 8 8 9 9 if ( ! defined('WP_ADMIN') ) { 10 // This file is being included from a file other than wp-admin/admin.php, so 11 // some setup was skipped. Make sure the admin message catalog is loaded since 12 // load_default_textdomain() will not have done so in this context. 10 /* 11 * This file is being included from a file other than wp-admin/admin.php, so 12 * some setup was skipped. Make sure the admin message catalog is loaded since 13 * load_default_textdomain() will not have done so in this context. 14 */ 13 15 load_textdomain( 'default', WP_LANG_DIR . '/admin-' . get_locale() . '.mo' ); 14 16 } -
trunk/src/wp-admin/includes/ajax-actions.php
r29178 r29206 22 22 $response = array(); 23 23 24 // screen_id is the same as $current_screen->id and the JS global 'pagenow' 24 // screen_id is the same as $current_screen->id and the JS global 'pagenow'. 25 25 if ( ! empty($_POST['screen_id']) ) 26 26 $screen_id = sanitize_key($_POST['screen_id']); … … 65 65 do_action( 'heartbeat_nopriv_tick', $response, $screen_id ); 66 66 67 // send the current time according to the server67 // Send the current time according to the server. 68 68 $response['server_time'] = time(); 69 69 … … 363 363 $comment_count = wp_count_comments($post_id); 364 364 365 if ( isset( $comment_count->$status ) ) // We're looking for a known type of comment count 365 // We're looking for a known type of comment count. 366 if ( isset( $comment_count->$status ) ) 366 367 $total = $comment_count->$status; 367 // else use the decremented value from above 368 } 369 370 $time = time(); // The time since the last comment count 368 // Else use the decremented value from above. 369 } 370 371 // The time since the last comment count. 372 $time = time(); 371 373 372 374 $x = new WP_Ajax_Response( array( 373 375 'what' => 'comment', 374 'id' => $comment_id, // here for completeness - not used 376 // Here for completeness - not used. 377 'id' => $comment_id, 375 378 'supplemental' => array( 376 379 'total_items_i18n' => sprintf( _n( '1 item', '%s items', $total ), number_format_i18n( $total ) ), … … 956 959 $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID'); 957 960 958 // automatically approve parent comment961 // Automatically approve parent comment. 959 962 if ( !empty($_POST['approve_parent']) ) { 960 963 $parent = get_comment( $comment_parent ); … … 1513 1516 1514 1517 $post = get_post( $post_ID, ARRAY_A ); 1515 $post = wp_slash($post); //since it is from db 1518 1519 // Since it's coming from the database. 1520 $post = wp_slash($post); 1516 1521 1517 1522 $data['content'] = $post['post_content']; 1518 1523 $data['excerpt'] = $post['post_excerpt']; 1519 1524 1520 // rename1525 // Rename. 1521 1526 $data['user_ID'] = get_current_user_id(); 1522 1527 … … 1524 1529 $data['parent_id'] = $data['post_parent']; 1525 1530 1526 // status1531 // Status. 1527 1532 if ( isset($data['keep_private']) && 'private' == $data['keep_private'] ) 1528 1533 $data['post_status'] = 'private'; … … 1541 1546 } 1542 1547 1543 // update the post1548 // Update the post. 1544 1549 edit_post(); 1545 1550 … … 1687 1692 unset( $_POST['savewidgets'], $_POST['action'] ); 1688 1693 1689 // save widgets order for all sidebars1694 // Save widgets order for all sidebars. 1690 1695 if ( is_array($_POST['sidebars']) ) { 1691 1696 $sidebars = array(); … … 1752 1757 $sidebar = isset($sidebars[$sidebar_id]) ? $sidebars[$sidebar_id] : array(); 1753 1758 1754 // delete1759 // Delete. 1755 1760 if ( isset($_POST['delete_widget']) && $_POST['delete_widget'] ) { 1756 1761 … … 2412 2417 2413 2418 $post = get_post( isset( $_POST['post_id'] ) ? $_POST['post_id'] : 0 ); 2414 // ping WordPress for an embed 2419 2420 // Ping WordPress for an embed. 2415 2421 $check_embed = $wp_embed->run_shortcode( '[embed]'. $src .'[/embed]' ); 2416 // fallback that WordPress creates when no oEmbed was found 2422 2423 // Fallback that WordPress creates when no oEmbed was found. 2417 2424 $fallback = $wp_embed->maybe_make_link( $src ); 2418 2425 … … 2457 2464 } 2458 2465 2459 // screen_id is the same as $current_screen->id and the JS global 'pagenow' 2466 // screen_id is the same as $current_screen->id and the JS global 'pagenow'. 2460 2467 if ( ! empty($_POST['screen_id']) ) 2461 2468 $screen_id = sanitize_key($_POST['screen_id']); -
trunk/src/wp-admin/includes/class-wp-comments-list-table.php
r29137 r29206 425 425 426 426 if ( $user_can ) { 427 // preorder it: Approve | Reply | Quick Edit | Edit | Spam | Trash427 // Preorder it: Approve | Reply | Quick Edit | Edit | Spam | Trash. 428 428 $actions = array( 429 429 'approve' => '', 'unapprove' => '', … … 435 435 ); 436 436 437 if ( $comment_status && 'all' != $comment_status ) { // not looking at all comments 437 // Not looking at all comments. 438 if ( $comment_status && 'all' != $comment_status ) { 438 439 if ( 'approved' == $the_comment_status ) 439 440 $actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=unapproved' class='vim-u vim-destructive' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>'; -
trunk/src/wp-admin/includes/class-wp-filesystem-base.php
r29165 r29206 309 309 continue; // We want this to be caught by the next code block. 310 310 311 // Working from /home/ to /user/ to /wordpress/ see if that file exists within the current folder, 312 // If it's found, change into it and follow through looking for it. 313 // If it cant find WordPress down that route, it'll continue onto the next folder level, and see if that matches, and so on. 314 // If it reaches the end, and still cant find it, it'll return false for the entire function. 311 /* 312 * Working from /home/ to /user/ to /wordpress/ see if that file exists within 313 * the current folder, If it's found, change into it and follow through looking 314 * for it. If it cant find WordPress down that route, it'll continue onto the next 315 * folder level, and see if that matches, and so on. If it reaches the end, and still 316 * cant find it, it'll return false for the entire function. 317 */ 315 318 if ( isset($files[ $key ]) ){ 319 316 320 // Lets try that folder: 317 321 $newdir = trailingslashit(path_join($base, $key)); 318 322 if ( $this->verbose ) 319 323 printf( "\n" . __('Changing to %s') . "<br/>\n", $newdir ); 320 // only search for the remaining path tokens in the directory, not the full path again 324 325 // Only search for the remaining path tokens in the directory, not the full path again. 321 326 $newfolder = implode( '/', array_slice( $folder_parts, $index + 1 ) ); 322 327 if ( $ret = $this->search_for_folder( $newfolder, $newdir, $loop) ) -
trunk/src/wp-admin/includes/class-wp-filesystem-direct.php
r28488 r29206 225 225 return false; 226 226 227 // try using rename first. if that fails (for example, source is read only) try copy227 // Try using rename first. if that fails (for example, source is read only) try copy. 228 228 if ( @rename($source, $destination) ) 229 229 return true; … … 306 306 307 307 public function mkdir($path, $chmod = false, $chown = false, $chgrp = false) { 308 // safe mode fails with a trailing slash under certain PHP versions.308 // Safe mode fails with a trailing slash under certain PHP versions. 309 309 $path = untrailingslashit($path); 310 310 if ( empty($path) ) -
trunk/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php
r28500 r29206 233 233 $list = $this->ftp->nlist( $file ); 234 234 return !empty( $list ); //empty list = no file, so invert. 235 // return $this->ftp->is_exists($file); has issues with ABOR+426 responses on the ncFTPd server235 // Return $this->ftp->is_exists($file); has issues with ABOR+426 responses on the ncFTPd server. 236 236 } 237 237 -
trunk/src/wp-admin/includes/class-wp-filesystem-ssh2.php
r28491 r29206 86 86 87 87 if ( empty ($opt['password']) ) { 88 if ( !$this->keys ) //password can be blank if we are using keys 88 // Password can be blank if we are using keys. 89 if ( !$this->keys ) 89 90 $this->errors->add('empty_password', __('SSH2 password is required')); 90 91 } else { -
trunk/src/wp-admin/includes/class-wp-importer.php
r28637 r29206 42 42 } while ( count( $results ) == $limit ); 43 43 44 // unset to save memory44 // Unset to save memory. 45 45 unset( $results, $r ); 46 46 … … 68 68 $count = intval( $result[0]->cnt ); 69 69 70 // unset to save memory70 // Unset to save memory. 71 71 unset( $results ); 72 72 … … 110 110 } while ( count( $results ) == $limit ); 111 111 112 // unset to save memory112 // Unset to save memory. 113 113 unset( $results, $r ); 114 114 -
trunk/src/wp-admin/includes/class-wp-list-table.php
r29199 r29206 202 202 $args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] ); 203 203 204 // redirect if page number is invalid and headers are not already sent204 // Redirect if page number is invalid and headers are not already sent. 205 205 if ( ! headers_sent() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) && $args['total_pages'] > 0 && $this->get_pagenum() > $args['total_pages'] ) { 206 206 wp_redirect( add_query_arg( 'paged', $args['total_pages'] ) ); -
trunk/src/wp-admin/includes/class-wp-ms-sites-list-table.php
r29166 r29206 39 39 } 40 40 41 // If the network is large and a search is not being performed, show only the latest blogs with no paging in order 42 // to avoid expensive count queries. 41 /* 42 * If the network is large and a search is not being performed, show only 43 * the latest blogs with no paging in order to avoid expensive count queries. 44 */ 43 45 if ( !$s && wp_is_large_network() ) { 44 46 if ( !isset($_REQUEST['orderby']) ) -
trunk/src/wp-admin/includes/class-wp-ms-themes-list-table.php
r29137 r29206 34 34 35 35 protected function get_table_classes() { 36 return array( 'widefat', 'plugins' ); // todo: remove and add CSS for .themes 36 // todo: remove and add CSS for .themes 37 return array( 'widefat', 'plugins' ); 37 38 } 38 39 … … 269 270 } 270 271 271 // preorder272 // Pre-order. 272 273 $actions = array( 273 274 'enable' => '', -
trunk/src/wp-admin/includes/class-wp-ms-users-list-table.php
r29137 r29206 41 41 } 42 42 43 // If the network is large and a search is not being performed, show only the latest users with no paging in order 44 // to avoid expensive count queries. 43 /* 44 * If the network is large and a search is not being performed, 45 * show only the latest users with no paging in order to avoid 46 * expensive count queries. 47 */ 45 48 if ( !$usersearch && wp_is_large_network( 'users' ) ) { 46 49 if ( !isset($_REQUEST['orderby']) ) -
trunk/src/wp-admin/includes/class-wp-plugins-list-table.php
r29137 r29206 341 341 $screen = $this->screen; 342 342 343 // preorder343 // Pre-order. 344 344 $actions = array( 345 345 'deactivate' => '', -
trunk/src/wp-admin/includes/class-wp-posts-list-table.php
r29137 r29206 415 415 foreach ( $pages as $page ) { 416 416 417 // catch and repair bad pages417 // Catch and repair bad pages. 418 418 if ( $page->post_parent == $page->ID ) { 419 419 $page->post_parent = 0; … … 450 450 } 451 451 452 // if it is the last pagenum and there are orphaned pages, display them with paging as well452 // If it is the last pagenum and there are orphaned pages, display them with paging as well. 453 453 if ( isset( $children_pages ) && $count < $end ){ 454 454 foreach ( $children_pages as $orphans ){ … … 592 592 if ( $this->hierarchical_display ) { 593 593 if ( 0 == $level && (int) $post->post_parent > 0 ) { 594 // sent level 0 by accident, by default, or because we don't know the actual level594 // Sent level 0 by accident, by default, or because we don't know the actual level. 595 595 $find_main_page = (int) $post->post_parent; 596 596 while ( $find_main_page > 0 ) { -
trunk/src/wp-admin/includes/class-wp-terms-list-table.php
r29137 r29206 156 156 157 157 $page = $args['page']; 158 // set variable because $args['number'] can be subsequently overridden 158 159 // Set variable because $args['number'] can be subsequently overridden. 159 160 $number = $args['number']; 160 161 161 162 $args['offset'] = $offset = ( $page - 1 ) * $number; 162 163 163 // convert it to table rows164 // Convert it to table rows. 164 165 $count = 0; 165 166 -
trunk/src/wp-admin/includes/class-wp-theme-install-list-table.php
r29173 r29206 93 93 94 94 case 'featured': 95 // case 'popular':95 // case 'popular': 96 96 case 'new': 97 97 case 'updated': -
trunk/src/wp-admin/includes/class-wp-themes-list-table.php
r29170 r29206 74 74 return; 75 75 } 76 // else, fallthrough. install_themes doesn't help if you can't enable it.76 // Else, fallthrough. install_themes doesn't help if you can't enable it. 77 77 } else { 78 78 if ( current_user_can( 'install_themes' ) ) { -
trunk/src/wp-admin/includes/class-wp-upgrader.php
r28956 r29206 191 191 192 192 $args = wp_parse_args($args, $defaults); 193 // these were previously extract()'d 193 194 // These were previously extract()'d. 194 195 $source = $args['source']; 195 196 $destination = $args['destination']; … … 250 251 } 251 252 252 // Has the source location changed? If so, we need a new source_files list.253 // Has the source location changed? If so, we need a new source_files list. 253 254 if ( $source !== $remote_source ) { 254 255 $source_files = array_keys( $wp_filesystem->dirlist( $source ) ); 255 256 } 256 // Protection against deleting files in any important base directories. 257 // Theme_Upgrader & Plugin_Upgrader also trigger this, as they pass the destination directory (WP_PLUGIN_DIR / wp-content/themes) 258 // intending to copy the directory into the directory, whilst they pass the source as the actual files to copy. 257 /* 258 * Protection against deleting files in any important base directories. 259 * Theme_Upgrader & Plugin_Upgrader also trigger this, as they pass the 260 * destination directory (WP_PLUGIN_DIR / wp-content/themes) intending 261 * to copy the directory into the directory, whilst they pass the source 262 * as the actual files to copy. 263 */ 259 264 $protected_directories = array( ABSPATH, WP_CONTENT_DIR, WP_PLUGIN_DIR, WP_CONTENT_DIR . '/themes' ); 265 260 266 if ( is_array( $wp_theme_directories ) ) { 261 267 $protected_directories = array_merge( $protected_directories, $wp_theme_directories ); … … 717 723 } 718 724 719 // return plugin info.725 // Return plugin info. 720 726 public function plugin_info() { 721 727 if ( ! is_array($this->result) ) … … 1267 1273 $this->update_current = 0; 1268 1274 1269 // The filesystem's mkdir() is not recursive. Make sure WP_LANG_DIR exists, 1270 // as we then may need to create a /plugins or /themes directory inside of it. 1275 /* 1276 * The filesystem's mkdir() is not recursive. Make sure WP_LANG_DIR exists, 1277 * as we then may need to create a /plugins or /themes directory inside of it. 1278 */ 1271 1279 $remote_destination = $wp_filesystem->find_folder( WP_LANG_DIR ); 1272 1280 if ( ! $wp_filesystem->exists( $remote_destination ) ) … … 1470 1478 if ( is_wp_error( $result ) ) { 1471 1479 $error_code = $result->get_error_code(); 1472 // Not all errors are equal. These codes are critical: copy_failed__copy_dir, 1473 // mkdir_failed__copy_dir, copy_failed__copy_dir_retry, and disk_full. 1474 // do_rollback allows for update_core() to trigger a rollback if needed. 1480 /* 1481 * Not all errors are equal. These codes are critical: copy_failed__copy_dir, 1482 * mkdir_failed__copy_dir, copy_failed__copy_dir_retry, and disk_full. 1483 * do_rollback allows for update_core() to trigger a rollback if needed. 1484 */ 1475 1485 if ( false !== strpos( $error_code, 'do_rollback' ) ) 1476 1486 $try_rollback = true; … … 1602 1612 if ( ! apply_filters( 'allow_dev_auto_core_updates', $upgrade_dev ) ) 1603 1613 return false; 1604 // else fall through to minor + major branches below1614 // Else fall through to minor + major branches below. 1605 1615 } 1606 1616 … … 1693 1703 ); 1694 1704 1695 // Save the data 1705 // Save the data. 1696 1706 $this->id = wp_insert_attachment( $object, $file['file'] ); 1697 1707 1698 // schedule a cleanup for 2 hours from now in case of failed install1708 // Schedule a cleanup for 2 hours from now in case of failed install. 1699 1709 wp_schedule_single_event( time() + 2 * HOUR_IN_SECONDS, 'upgrader_scheduled_cleanup', array( $this->id ) ); 1700 1710 … … 2019 2029 $upgrade_result = $upgrader->upgrade( $upgrader_item, array( 2020 2030 'clear_update_cache' => false, 2021 'pre_check_md5' => false, /* always use partial builds if possible for core updates */ 2022 'attempt_rollback' => true, /* only available for core updates */ 2031 // Always use partial builds if possible for core updates. 2032 'pre_check_md5' => false, 2033 // Only available for core updates. 2034 'attempt_rollback' => true, 2023 2035 ) ); 2024 2036 2025 // if the filesystem is unavailable, false is returned.2037 // If the filesystem is unavailable, false is returned. 2026 2038 if ( false === $upgrade_result ) { 2027 2039 $upgrade_result = new WP_Error( 'fs_unavailable', __( 'Could not access filesystem.' ) ); 2028 2040 } 2029 2041 2030 // Core doesn't output this, so lets append it so we don't get confused 2042 // Core doesn't output this, so lets append it so we don't get confused. 2031 2043 if ( 'core' == $type ) { 2032 2044 if ( is_wp_error( $upgrade_result ) ) { -
trunk/src/wp-admin/includes/dashboard.php
r29170 r29206 532 532 $actions_string = ''; 533 533 if ( current_user_can( 'edit_comment', $comment->comment_ID ) ) { 534 // preorder it: Approve | Reply | Edit | Spam | Trash534 // Pre-order it: Approve | Reply | Edit | Spam | Trash. 535 535 $actions = array( 536 536 'approve' => '', 'unapprove' => '', … … 899 899 $widget_options[$widget_id] = wp_widget_rss_process( $_POST['widget-rss'][$number] ); 900 900 $widget_options[$widget_id]['number'] = $number; 901 // title is optional. If black, fill it if possible 901 902 // Title is optional. If black, fill it if possible. 902 903 if ( !$widget_options[$widget_id]['title'] && isset($_POST['widget-rss'][$number]['title']) ) { 903 904 $rss = fetch_feed($widget_options[$widget_id]['url']); -
trunk/src/wp-admin/includes/export.php
r28731 r29206 84 84 } 85 85 86 // grab a snapshot of post IDs, just in case it changes during the export86 // Grab a snapshot of post IDs, just in case it changes during the export. 87 87 $post_ids = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} $join WHERE $where" ); 88 88 89 // get the requested terms ready, empty unless posts filtered by category or all content 89 /* 90 * Get the requested terms ready, empty unless posts filtered by category 91 * or all content. 92 */ 90 93 $cats = $tags = $terms = array(); 91 94 if ( isset( $term ) && $term ) { … … 100 103 $custom_terms = (array) get_terms( $custom_taxonomies, array( 'get' => 'all' ) ); 101 104 102 // put categories in order with no child going before its parent105 // Put categories in order with no child going before its parent. 103 106 while ( $cat = array_shift( $categories ) ) { 104 107 if ( $cat->parent == 0 || isset( $cats[$cat->parent] ) ) … … 108 111 } 109 112 110 // put terms in order with no child going before its parent113 // Put terms in order with no child going before its parent. 111 114 while ( $t = array_shift( $custom_terms ) ) { 112 115 if ( $t->parent == 0 || isset( $terms[$t->parent] ) ) … … 145 148 */ 146 149 function wxr_site_url() { 147 // ms: the base url150 // Multisite: the base URL. 148 151 if ( is_multisite() ) 149 152 return network_home_url(); 150 // wp: the blog url153 // WordPress (single site): the blog URL. 151 154 else 152 155 return get_bloginfo_rss( 'url' ); … … 374 377 <?php if ( $post_ids ) { 375 378 global $wp_query; 376 $wp_query->in_the_loop = true; // Fake being in the loop. 377 378 // fetch 20 posts at a time rather than loading the entire table into memory 379 380 // Fake being in the loop. 381 $wp_query->in_the_loop = true; 382 383 // Fetch 20 posts at a time rather than loading the entire table into memory. 379 384 while ( $next_posts = array_splice( $post_ids, 0, 20 ) ) { 380 385 $where = 'WHERE ID IN (' . join( ',', $next_posts ) . ')'; 381 386 $posts = $wpdb->get_results( "SELECT * FROM {$wpdb->posts} $where" ); 382 387 383 // Begin Loop 388 // Begin Loop. 384 389 foreach ( $posts as $post ) { 385 390 setup_postdata( $post ); -
trunk/src/wp-admin/includes/file.php
r28893 r29206 180 180 wp_die( __( 'Sorry, that file cannot be edited.' ) ); 181 181 182 // case 2 :183 // 182 // case 2 : 183 // wp_die( __('Sorry, can’t call files with their real path.' )); 184 184 185 185 case 3 : … … 258 258 __( "File upload stopped by extension." )); 259 259 260 // this may not have orignially been intended to be overrideable, but historically has been 260 /* 261 * This may not have orignially been intended to be overrideable, 262 * but historically has been. 263 */ 261 264 if ( isset( $overrides['upload_error_strings'] ) ) { 262 265 $upload_error_strings = $overrides['upload_error_strings']; … … 268 271 $test_upload = isset( $overrides['test_upload'] ) ? $overrides['test_upload'] : true; 269 272 270 // If you override this, you must provide $ext and $type!! !!273 // If you override this, you must provide $ext and $type!! 271 274 $test_type = isset( $overrides['test_type'] ) ? $overrides['test_type'] : true; 272 275 $mimes = isset( $overrides['mimes'] ) ? $overrides['mimes'] : false; … … 315 318 } 316 319 317 // A writable uploads dir will pass this test. Again, there's no point overriding this one. 320 /* 321 * A writable uploads dir will pass this test. Again, there's no point 322 * overriding this one. 323 */ 318 324 if ( ! ( ( $uploads = wp_upload_dir($time) ) && false === $uploads['error'] ) ) 319 325 return call_user_func($upload_error_handler, $file, $uploads['error'] ); … … 321 327 $filename = wp_unique_filename( $uploads['path'], $file['name'], $unique_filename_callback ); 322 328 323 // Move the file to the uploads dir 329 // Move the file to the uploads dir. 324 330 $new_file = $uploads['path'] . "/$filename"; 325 331 if ( false === @ move_uploaded_file( $file['tmp_name'], $new_file ) ) { … … 332 338 } 333 339 334 // Set correct file permissions 340 // Set correct file permissions. 335 341 $stat = stat( dirname( $new_file )); 336 342 $perms = $stat['mode'] & 0000666; 337 343 @ chmod( $new_file, $perms ); 338 344 339 // Compute the URL 345 // Compute the URL. 340 346 $url = $uploads['url'] . "/$filename"; 341 347 … … 1052 1058 $credentials['private_key'] = defined('FTP_PRIKEY') ? FTP_PRIKEY : (!empty($_POST['private_key']) ? wp_unslash( $_POST['private_key'] ) : ''); 1053 1059 1054 // sanitize the hostname, Some people might pass in odd-data:1060 // Sanitize the hostname, Some people might pass in odd-data: 1055 1061 $credentials['hostname'] = preg_replace('|\w+://|', '', $credentials['hostname']); //Strip any schemes off 1056 1062 -
trunk/src/wp-admin/includes/image-edit.php
r28366 r29206 412 412 return $image; 413 413 414 // expand change operations414 // Expand change operations. 415 415 foreach ( $changes as $key => $obj ) { 416 416 if ( isset($obj->r) ) { … … 430 430 } 431 431 432 // combine operations432 // Combine operations. 433 433 if ( count($changes) > 1 ) { 434 434 $filtered = array($changes[0]); … … 454 454 } 455 455 456 // image resource before applying the changes456 // Image resource before applying the changes. 457 457 if ( $image instanceof WP_Image_Editor ) { 458 458 … … 541 541 $img = image_edit_apply_changes( $img, $changes ); 542 542 543 // scale the image543 // Scale the image. 544 544 $size = $img->get_size(); 545 545 $w = $size['width']; … … 577 577 if ( $parts['basename'] != $data['file'] ) { 578 578 if ( defined('IMAGE_EDIT_OVERWRITE') && IMAGE_EDIT_OVERWRITE ) { 579 // delete only if it's edited image 579 580 // Delete only if it's edited image. 580 581 if ( preg_match('/-e[0-9]{13}\./', $parts['basename']) ) { 581 582 … … 602 603 if ( isset($meta['sizes'][$default_size]) && $meta['sizes'][$default_size]['file'] != $data['file'] ) { 603 604 if ( defined('IMAGE_EDIT_OVERWRITE') && IMAGE_EDIT_OVERWRITE ) { 604 // delete only if it's edited image 605 606 // Delete only if it's edited image 605 607 if ( preg_match('/-e[0-9]{13}-/', $meta['sizes'][$default_size]['file']) ) { 606 608 /** This filter is documented in wp-admin/custom-header.php */ … … 662 664 $sY = $size['height']; 663 665 664 // check if it has roughly the same w / h ratio666 // Check if it has roughly the same w / h ratio. 665 667 $diff = round($sX / $sY, 2) - round($fwidth / $fheight, 2); 666 668 if ( -0.1 < $diff && $diff < 0.1 ) { 667 // scale the full size image669 // Scale the full size image. 668 670 if ( $img->resize( $fwidth, $fheight ) ) 669 671 $scaled = true; … … 694 696 $backup_sizes = array(); 695 697 696 // generate new filename698 // Generate new filename. 697 699 $path = get_attached_file($post_id); 698 700 $path_parts = pathinfo( $path ); … … 720 722 } 721 723 722 // save the full-size file, also needed to create sub-sizes724 // Save the full-size file, also needed to create sub-sizes. 723 725 if ( !wp_save_image_file($new_path, $img, $post->post_mime_type, $post_id) ) { 724 726 $return->error = esc_js( __('Unable to save the image.') ); -
trunk/src/wp-admin/includes/image.php
r28808 r29206 48 48 $dst_file = str_replace( basename( $src_file ), 'cropped-' . basename( $src_file ), $src_file ); 49 49 50 // The directory containing the original file may no longer exist when 51 // using a replication plugin. 50 /* 51 * The directory containing the original file may no longer exist when 52 * using a replication plugin. 53 */ 52 54 wp_mkdir_p( dirname( $dst_file ) ); 53 55 … … 80 82 $metadata['height'] = $imagesize[1]; 81 83 82 // Make the file path relative to the upload dir 84 // Make the file path relative to the upload dir. 83 85 $metadata['file'] = _wp_relative_upload_path($file); 84 86 85 // make thumbnails and other intermediate sizes87 // Make thumbnails and other intermediate sizes. 86 88 global $_wp_additional_image_sizes; 87 89 … … 121 123 } 122 124 123 // fetch additional metadata from exif/iptc125 // Fetch additional metadata from EXIF/IPTC. 124 126 $image_meta = wp_read_image_metadata( $file ); 125 127 if ( $image_meta ) … … 135 137 136 138 if ( $support && ! empty( $metadata['image']['data'] ) ) { 137 // check for existing cover139 // Check for existing cover. 138 140 $hash = md5( $metadata['image']['data'] ); 139 141 $posts = get_posts( array( … … 188 190 } 189 191 190 // remove the blob of binary data from the array192 // Remove the blob of binary data from the array. 191 193 if ( isset( $metadata['image']['data'] ) ) 192 194 unset( $metadata['image']['data'] ); … … 255 257 list( , , $sourceImageType ) = getimagesize( $file ); 256 258 257 // exif contains a bunch of data we'll probably never need formatted in ways 258 // that are difficult to use. We'll normalize it and just extract the fields 259 // that are likely to be useful. Fractions and numbers are converted to 260 // floats, dates to unix timestamps, and everything else to strings. 259 /* 260 * EXIF contains a bunch of data we'll probably never need formatted in ways 261 * that are difficult to use. We'll normalize it and just extract the fields 262 * that are likely to be useful. Fractions and numbers are converted to 263 * floats, dates to unix timestamps, and everything else to strings. 264 */ 261 265 $meta = array( 262 266 'aperture' => 0, … … 272 276 ); 273 277 274 // read iptc first, since it might contain data not available in exif such 275 // as caption, description etc 278 /* 279 * Read IPTC first, since it might contain data not available in exif such 280 * as caption, description etc. 281 */ 276 282 if ( is_callable( 'iptcparse' ) ) { 277 283 getimagesize( $file, $info ); … … 280 286 $iptc = iptcparse( $info['APP13'] ); 281 287 282 // headline, "A brief synopsis of the caption."283 if ( ! empty( $iptc['2#105'][0] ) ) 288 // Headline, "A brief synopsis of the caption." 289 if ( ! empty( $iptc['2#105'][0] ) ) { 284 290 $meta['title'] = trim( $iptc['2#105'][0] ); 285 // title, "Many use the Title field to store the filename of the image, though the field may be used in many ways." 286 elseif ( ! empty( $iptc['2#005'][0] ) ) 291 /* 292 * Title, "Many use the Title field to store the filename of the image, 293 * though the field may be used in many ways." 294 */ 295 } elseif ( ! empty( $iptc['2#005'][0] ) ) { 287 296 $meta['title'] = trim( $iptc['2#005'][0] ); 297 } 288 298 289 299 if ( ! empty( $iptc['2#120'][0] ) ) { // description / legacy caption … … 569 579 $dst_file = dirname( $dst_file ) . '/' . wp_unique_filename( dirname( $dst_file ), basename( $dst_file ) ); 570 580 571 // The directory containing the original file may no longer exist when 572 // using a replication plugin. 581 /* 582 * The directory containing the original file may no longer 583 * exist when using a replication plugin. 584 */ 573 585 wp_mkdir_p( dirname( $dst_file ) ); 574 586 -
trunk/src/wp-admin/includes/import.php
r28479 r29206 106 106 $id = wp_insert_attachment( $object, $file ); 107 107 108 // schedule a cleanup for one day from now in case of failed import or missing wp_import_cleanup() call 108 /* 109 * Schedule a cleanup for one day from now in case of failed 110 * import or missing wp_import_cleanup() call. 111 */ 109 112 wp_schedule_single_event( time() + DAY_IN_SECONDS, 'importer_scheduled_cleanup', array( $id ) ); 110 113 -
trunk/src/wp-admin/includes/media.php
r29029 r29206 181 181 $caption = str_replace( array("\r\n", "\r"), "\n", $caption); 182 182 $caption = preg_replace_callback( '/<[a-zA-Z0-9]+(?: [^<>]+>)*/', '_cleanup_image_add_caption', $caption ); 183 // convert any remaining line breaks to <br> 183 184 // Convert any remaining line breaks to <br>. 184 185 $caption = preg_replace( '/[ \n\t]*\n[ \t]*/', '<br />', $caption ); 185 186 … … 209 210 */ 210 211 function _cleanup_image_add_caption( $matches ) { 211 // remove any line breaks from inside the tags212 // Remove any line breaks from inside the tags. 212 213 return preg_replace( '/[\r\n\t]+/', ' ', $matches[0] ); 213 214 } … … 318 319 $content .= ' ' . sprintf( __( 'Genre: %s.' ), $meta['genre'] ); 319 320 320 // use image exif/iptc data for title and caption defaults if possible321 // Use image exif/iptc data for title and caption defaults if possible. 321 322 } elseif ( $image_meta = @wp_read_image_metadata( $file ) ) { 322 323 if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) … … 379 380 $content = ''; 380 381 381 // use image exif/iptc data for title and caption defaults if possible382 // Use image exif/iptc data for title and caption defaults if possible. 382 383 if ( $image_meta = @wp_read_image_metadata($file) ) { 383 384 if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) … … 390 391 $title = $desc; 391 392 392 // Construct the attachment array 393 // Construct the attachment array. 393 394 $attachment = array_merge( array( 394 395 'post_mime_type' => $type, … … 635 636 if ( $image_alt != get_post_meta($attachment_id, '_wp_attachment_image_alt', true) ) { 636 637 $image_alt = wp_strip_all_tags( $image_alt, true ); 637 // update_meta expects slashed 638 639 // Update_meta expects slashed. 638 640 update_post_meta( $attachment_id, '_wp_attachment_image_alt', wp_slash( $image_alt ) ); 639 641 } … … 808 810 function media_sideload_image( $file, $post_id, $desc = null ) { 809 811 if ( ! empty( $file ) ) { 810 // Set variables for storage 811 // fix file filename for query strings 812 // Set variables for storage, fix file filename for query strings. 812 813 preg_match( '/[^\?]+\.(jpe?g|jpe|gif|png)\b/i', $file, $matches ); 813 814 $file_array['name'] = basename( $matches[0] ); 814 // Download file to temp location 815 816 // Download file to temp location. 815 817 $file_array['tmp_name'] = download_url( $file ); 816 818 … … 820 822 } 821 823 822 // do the validation and storage stuff824 // Do the validation and storage stuff. 823 825 $id = media_handle_sideload( $file_array, $post_id, $desc ); 824 // If error storing permanently, unlink 826 827 // If error storing permanently, unlink. 825 828 if ( is_wp_error( $id ) ) { 826 829 @unlink( $file_array['tmp_name'] ); … … 831 834 } 832 835 833 // Finally check to make sure the file has been saved, then return the html836 // Finally check to make sure the file has been saved, then return the HTML. 834 837 if ( ! empty( $src ) ) { 835 838 $alt = isset( $desc ) ? esc_attr( $desc ) : ''; … … 944 947 $checked = ''; 945 948 946 // is this size selectable?949 // Is this size selectable? 947 950 $enabled = ( $downsize[3] || 'full' == $size ); 948 951 $css_id = "image-size-{$size}-{$post->ID}"; 949 // if this size is the default but that's not available, don't select it 952 953 // If this size is the default but that's not available, don't select it. 950 954 if ( $size == $check ) { 951 955 if ( $enabled ) … … 954 958 $check = ''; 955 959 } elseif ( !$check && $enabled && 'thumbnail' != $size ) { 956 // if $check is not enabled, default to the first available size that's bigger than a thumbnail 960 /* 961 * If $check is not enabled, default to the first available size 962 * that's bigger than a thumbnail. 963 */ 957 964 $check = $size; 958 965 $checked = " checked='checked'"; … … 962 969 963 970 $html .= "<label for='{$css_id}'>$label</label>"; 964 // only show the dimensions if that choice is available 971 972 // Only show the dimensions if that choice is available. 965 973 if ( $enabled ) 966 974 $html .= " <label for='{$css_id}' class='help'>" . sprintf( "(%d × %d)", $downsize[1], $downsize[2] ). "</label>"; … … 1010 1018 1011 1019 function wp_caption_input_textarea($edit_post) { 1012 // post data is already escaped1020 // Post data is already escaped. 1013 1021 $name = "attachments[{$edit_post->ID}][post_excerpt]"; 1014 1022 … … 1473 1481 elseif ( $field['input'] == 'textarea' ) { 1474 1482 if ( 'post_content' == $id && user_can_richedit() ) { 1475 // sanitize_post() skips the post_content when user_can_richedit1483 // Sanitize_post() skips the post_content when user_can_richedit. 1476 1484 $field['value'] = htmlspecialchars( $field['value'], ENT_QUOTES ); 1477 1485 } 1478 // post_excerpt is already escaped by sanitize_post() in get_attachment_fields_to_edit()1486 // Post_excerpt is already escaped by sanitize_post() in get_attachment_fields_to_edit(). 1479 1487 $item .= "<textarea id='$name' name='$name' $aria_required>" . $field['value'] . '</textarea>'; 1480 1488 } else { … … 1622 1630 elseif ( $field['input'] == 'textarea' ) { 1623 1631 if ( 'post_content' == $id && user_can_richedit() ) { 1624 // sanitize_post() skips the post_content when user_can_richedit 1632 // sanitize_post() skips the post_content when user_can_richedit. 1625 1633 $field['value'] = htmlspecialchars( $field['value'], ENT_QUOTES ); 1626 1634 } … … 2853 2861 if ( ! empty( $list ) ) { 2854 2862 $metadata[$key] = reset( $list ); 2855 // fix bug in byte stream analysis2863 // Fix bug in byte stream analysis. 2856 2864 if ( 'terms_of_use' === $key && 0 === strpos( $metadata[$key], 'yright notice.' ) ) 2857 2865 $metadata[$key] = 'Cop' . $metadata[$key]; -
trunk/src/wp-admin/includes/menu.php
r28500 r29206 98 98 $old_parent = $data[2]; 99 99 $new_parent = $first_sub[2]; 100 // If the first submenu is not the same as the assigned parent, 101 // make the first submenu the new parent. 100 /* 101 * If the first submenu is not the same as the assigned parent, 102 * make the first submenu the new parent. 103 */ 102 104 if ( $new_parent != $old_parent ) { 103 105 $_wp_real_parent_file[$old_parent] = $new_parent; -
trunk/src/wp-admin/includes/misc.php
r28919 r29206 164 164 $htaccess_file = $home_path.'.htaccess'; 165 165 166 // If the file doesn't already exist check for write access to the directory and whether we have some rules. 167 // else check for write access to the file. 166 /* 167 * If the file doesn't already exist check for write access to the directory 168 * and whether we have some rules. Else check for write access to the file. 169 */ 168 170 if ((!file_exists($htaccess_file) && is_writable($home_path) && $wp_rewrite->using_mod_rewrite_permalinks()) || is_writable($htaccess_file)) { 169 171 if ( got_mod_rewrite() ) { -
trunk/src/wp-admin/includes/ms-deprecated.php
r21823 r29206 15 15 function wpmu_menu() { 16 16 _deprecated_function(__FUNCTION__, '3.0' ); 17 // deprecated. See #1176317 // Deprecated. See #11763. 18 18 } 19 19 -
trunk/src/wp-admin/includes/nav-menu.php
r28500 r29206 517 517 if ( $post_type ) { 518 518 $id = $post_type->name; 519 // give pages a higher priority519 // Give pages a higher priority. 520 520 $priority = ( 'page' == $post_type->name ? 'core' : 'default' ); 521 521 add_meta_box( "add-{$id}", $post_type->labels->name, 'wp_nav_menu_item_post_type_meta_box', 'nav-menus', 'side', $priority, $post_type ); … … 616 616 $post_type_name = $post_type['args']->name; 617 617 618 // paginate browsing for large numbers of post objects618 // Paginate browsing for large numbers of post objects. 619 619 $per_page = 50; 620 620 $pagenum = isset( $_REQUEST[$post_type_name . '-tab'] ) && isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 1; … … 763 763 $args['walker'] = $walker; 764 764 765 // if we're dealing with pages, let's put a checkbox for the front page at the top of the list 765 /* 766 * If we're dealing with pages, let's put a checkbox for the front 767 * page at the top of the list. 768 */ 766 769 if ( 'page' == $post_type_name ) { 767 770 $front_page = 'page' == get_option('show_on_front') ? (int) get_option( 'page_on_front' ) : 0; … … 855 858 $taxonomy_name = $taxonomy['args']->name; 856 859 857 // paginate browsing for large numbers of objects860 // Paginate browsing for large numbers of objects. 858 861 $per_page = 50; 859 862 $pagenum = isset( $_REQUEST[$taxonomy_name . '-tab'] ) && isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 1; … … 1046 1049 if ( 0 == $menu_id || is_nav_menu( $menu_id ) ) { 1047 1050 1048 // Loop through all the menu items' POST values 1051 // Loop through all the menu items' POST values. 1049 1052 foreach( (array) $menu_data as $_possible_db_id => $_item_object_data ) { 1050 1053 if ( 1051 empty( $_item_object_data['menu-item-object-id'] ) && // checkbox is not checked 1054 // Checkbox is not checked. 1055 empty( $_item_object_data['menu-item-object-id'] ) && 1052 1056 ( 1053 ! isset( $_item_object_data['menu-item-type'] ) || // and item type either isn't set 1054 in_array( $_item_object_data['menu-item-url'], array( 'http://', '' ) ) || // or URL is the default 1057 // And item type either isn't set. 1058 ! isset( $_item_object_data['menu-item-type'] ) || 1059 // Or URL is the default. 1060 in_array( $_item_object_data['menu-item-url'], array( 'http://', '' ) ) || 1055 1061 ! ( 'custom' == $_item_object_data['menu-item-type'] && ! isset( $_item_object_data['menu-item-db-id'] ) ) || // or it's not a custom menu item (but not the custom home page) 1056 ! empty( $_item_object_data['menu-item-db-id'] ) // or it *is* a custom menu item that already exists 1062 // Or it *is* a custom menu item that already exists. 1063 ! empty( $_item_object_data['menu-item-db-id'] ) 1057 1064 ) 1058 1065 ) { 1059 continue; // then this potential menu item is not getting added to this menu 1066 // Then this potential menu item is not getting added to this menu. 1067 continue; 1060 1068 } 1061 1069 1062 // if this possible menu item doesn't actually have a menu database ID yet1070 // If this possible menu item doesn't actually have a menu database ID yet. 1063 1071 if ( 1064 1072 empty( $_item_object_data['menu-item-db-id'] ) || … … 1113 1121 ); 1114 1122 1115 // posts should show only published items1123 // Posts should show only published items. 1116 1124 } elseif ( 'post' == $object->name ) { 1117 1125 $object->_default_query = array( … … 1119 1127 ); 1120 1128 1121 // cats should be in reverse chronological order1129 // Categories should be in reverse chronological order. 1122 1130 } elseif ( 'category' == $object->name ) { 1123 1131 $object->_default_query = array( … … 1126 1134 ); 1127 1135 1128 // custom post types should show only published items1136 // Custom post types should show only published items. 1129 1137 } else { 1130 1138 $object->_default_query = array( … … 1227 1235 $delete_timestamp = time() - ( DAY_IN_SECONDS * EMPTY_TRASH_DAYS ); 1228 1236 1229 // delete orphaned draft menu items1237 // Delete orphaned draft menu items. 1230 1238 $menu_items_to_delete = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts AS p LEFT JOIN $wpdb->postmeta AS m ON p.ID = m.post_id WHERE post_type = 'nav_menu_item' AND post_status = 'draft' AND meta_key = '_menu_item_orphaned' AND meta_value < '%d'", $delete_timestamp ) ); 1231 1239 -
trunk/src/wp-admin/includes/plugin-install.php
r29125 r29206 246 246 */ 247 247 function install_plugin_install_status($api, $loop = false) { 248 // this function is called recursively, $loop prevents further loops.248 // This function is called recursively, $loop prevents further loops. 249 249 if ( is_array($api) ) 250 250 $api = (object) $api; 251 251 252 // Default to a "new" plugin252 // Default to a "new" plugin 253 253 $status = 'install'; 254 254 $url = false; 255 255 256 //Check to see if this plugin is known to be installed, and has an update awaiting it. 256 /* 257 * Check to see if this plugin is known to be installed, 258 * and has an update awaiting it. 259 */ 257 260 $update_plugins = get_site_transient('update_plugins'); 258 261 if ( isset( $update_plugins->response ) ) { … … 439 442 if ( ! empty( $api->ratings ) && array_sum( (array) $api->ratings ) > 0 ) { 440 443 foreach( $api->ratings as $key => $ratecount ) { 441 // avoid div-by-zero444 // Avoid div-by-zero. 442 445 $_rating = $api->num_ratings ? ( $ratecount / $api->num_ratings ) : 0; 443 446 ?> -
trunk/src/wp-admin/includes/plugin.php
r28673 r29206 852 852 function validate_active_plugins() { 853 853 $plugins = get_option( 'active_plugins', array() ); 854 // validate vartype: array854 // Validate vartype: array. 855 855 if ( ! is_array( $plugins ) ) { 856 856 update_option( 'active_plugins', array() ); … … 868 868 $invalid = array(); 869 869 870 // invalid plugins get deactivated870 // Invalid plugins get deactivated. 871 871 foreach ( $plugins as $plugin ) { 872 872 $result = validate_plugin( $plugin ); … … 1120 1120 } 1121 1121 1122 // If the parent doesn't already have a submenu, add a link to the parent 1123 // as the first item in the submenu. If the submenu file is the same as the 1124 // parent file someone is trying to link back to the parent manually. In 1125 // this case, don't automatically add a link back to avoid duplication. 1122 /* 1123 * If the parent doesn't already have a submenu, add a link to the parent 1124 * as the first item in the submenu. If the submenu file is the same as the 1125 * parent file someone is trying to link back to the parent manually. In 1126 * this case, don't automatically add a link back to avoid duplication. 1127 */ 1126 1128 if (!isset( $submenu[$parent_slug] ) && $menu_slug != $parent_slug ) { 1127 1129 foreach ( (array)$menu as $parent_menu ) { … … 1138 1140 1139 1141 $_registered_pages[$hookname] = true; 1140 // backwards-compatibility for plugins using add_management page. See wp-admin/admin.php for redirect from edit.php to tools.php 1142 1143 /* 1144 * Backward-compatibility for plugins using add_management page. 1145 * See wp-admin/admin.php for redirect from edit.php to tools.php 1146 */ 1141 1147 if ( 'tools.php' == $parent_slug ) 1142 1148 $_registered_pages[get_plugin_page_hookname( $menu_slug, 'edit.php')] = true; 1143 1149 1144 // No parent as top level 1150 // No parent as top level. 1145 1151 $_parent_pages[$menu_slug] = $parent_slug; 1146 1152 -
trunk/src/wp-admin/includes/post.php
r28969 r29206 303 303 if ( $image_alt != get_post_meta( $post_ID, '_wp_attachment_image_alt', true ) ) { 304 304 $image_alt = wp_strip_all_tags( $image_alt, true ); 305 // update_meta expects slashed 305 // update_meta expects slashed. 306 306 update_post_meta( $post_ID, '_wp_attachment_image_alt', wp_slash( $image_alt ) ); 307 307 } … … 741 741 742 742 if ( ('0' === $metavalue || ! empty ( $metavalue ) ) && ( ( ( '#NONE#' != $metakeyselect ) && !empty ( $metakeyselect) ) || !empty ( $metakeyinput ) ) ) { 743 // We have a key/value pair. If both the select and the 744 // input for the key have data, the input takes precedence: 745 743 /* 744 * We have a key/value pair. If both the select and the input 745 * for the key have data, the input takes precedence. 746 */ 746 747 if ( '#NONE#' != $metakeyselect ) 747 748 $metakey = $metakeyselect; -
trunk/src/wp-admin/includes/revision.php
r28500 r29206 178 178 } 179 179 180 // If a post has been saved since the last revision (no revisioned fields were changed) 181 // we may not have a "current" revision. Mark the latest revision as "current". 180 /* 181 * If a post has been saved since the last revision (no revisioned fields 182 * were changed), we may not have a "current" revision. Mark the latest 183 * revision as "current". 184 */ 182 185 if ( empty( $current_id ) ) { 183 186 if ( $revisions[ $revision->ID ]['autosave'] ) { … … 193 196 } 194 197 195 // Now, grab the initial diff 198 // Now, grab the initial diff. 196 199 $compare_two_mode = is_numeric( $from ); 197 200 if ( ! $compare_two_mode ) { -
trunk/src/wp-admin/includes/schema.php
r29188 r29206 206 206 ) $charset_collate;\n"; 207 207 208 // usermeta208 // Usermeta. 209 209 $usermeta_table = "CREATE TABLE $wpdb->usermeta ( 210 210 umeta_id bigint(20) unsigned NOT NULL auto_increment, … … 523 523 $wpdb->query("INSERT INTO $wpdb->options (option_name, option_value, autoload) VALUES " . $insert); 524 524 525 // in case it is set, but blank, update "home"525 // In case it is set, but blank, update "home". 526 526 if ( !__get_option('home') ) update_option('home', $guessurl); 527 527 528 // Delete unused options 528 // Delete unused options. 529 529 $unusedoptions = array( 530 530 'blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', … … 548 548 delete_option($option); 549 549 550 // delete obsolete magpie stuff550 // Delete obsolete magpie stuff. 551 551 $wpdb->query("DELETE FROM $wpdb->options WHERE option_name REGEXP '^rss_[0-9a-f]{32}(_ts)?$'"); 552 552 553 // Deletes all expired transients. 554 // The multi-table delete syntax is used to delete the transient record from table a, 555 // and the corresponding transient_timeout record from table b. 553 /* 554 * Deletes all expired transients. The multi-table delete syntax is used 555 * to delete the transient record from table a, and the corresponding 556 * transient_timeout record from table b. 557 */ 556 558 $time = time(); 557 559 $sql = "DELETE a, b FROM $wpdb->options a, $wpdb->options b … … 820 822 $role->add_cap( 'remove_users' ); 821 823 822 // Never used, will be removed. create_users or 823 // promote_users is the capability you're looking for. 824 /* 825 * Never used, will be removed. create_users or promote_users 826 * is the capability you're looking for. 827 */ 824 828 $role->add_cap( 'add_users' ); 825 829 … … 864 868 $errors->add( 'empty_sitename', __( 'You must provide a name for your network of sites.' ) ); 865 869 866 // check for network collision870 // Check for network collision. 867 871 if ( $network_id == $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->site WHERE id = %d", $network_id ) ) ) 868 872 $errors->add( 'siteid_exists', __( 'The network already exists.' ) ); … … 875 879 return $errors; 876 880 877 // set up site tables881 // Set up site tables. 878 882 $template = get_option( 'template' ); 879 883 $stylesheet = get_option( 'stylesheet' ); … … 921 925 922 926 $misc_exts = array( 923 // images927 // Images. 924 928 'jpg', 'jpeg', 'png', 'gif', 925 // video929 // Video. 926 930 'mov', 'avi', 'mpg', '3gp', '3g2', 927 // "audio" 931 // "audio". 928 932 'midi', 'mid', 929 // misc933 // Miscellaneous. 930 934 'pdf', 'doc', 'ppt', 'odt', 'pptx', 'docx', 'pps', 'ppsx', 'xls', 'xlsx', 'key', 931 935 ); … … 982 986 $wpdb->query( "INSERT INTO $wpdb->sitemeta ( site_id, meta_key, meta_value ) VALUES " . $insert ); 983 987 984 // When upgrading from single to multisite, assume the current site will become the main site of the network. 985 // When using populate_network() to create another network in an existing multisite environment, 986 // skip these steps since the main site of the new network has not yet been created. 988 /* 989 * When upgrading from single to multisite, assume the current site will 990 * become the main site of the network. When using populate_network() 991 * to create another network in an existing multisite environment, skip 992 * these steps since the main site of the new network has not yet been 993 * created. 994 */ 987 995 if ( ! is_multisite() ) { 988 996 $current_site = new stdClass; -
trunk/src/wp-admin/includes/template.php
r28976 r29206 584 584 if ( is_serialized( $entry['meta_value'] ) ) { 585 585 if ( is_serialized_string( $entry['meta_value'] ) ) { 586 // this is a serialized string, so we should display it586 // This is a serialized string, so we should display it. 587 587 $entry['meta_value'] = maybe_unserialize( $entry['meta_value'] ); 588 588 } else { 589 // this is a serialized array/object so we should NOT display it589 // This is a serialized array/object so we should NOT display it. 590 590 --$count; 591 591 return; … … 717 717 $tab_index_attribute = " tabindex=\"$tab_index\""; 718 718 719 // todo: Remove this? 719 720 // echo '<label for="timestamp" style="display: block;"><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> '.__( 'Edit timestamp' ).'</label><br />'; 720 721 … … 941 942 if ( false === $wp_meta_boxes[$page][$a_context][$a_priority][$id] ) 942 943 return; 943 // If box was added with default priority, give it core priority to maintain sort order 944 945 /* 946 * If box was added with default priority, give it core priority to 947 * maintain sort order. 948 */ 944 949 if ( 'default' == $a_priority ) { 945 950 $wp_meta_boxes[$page][$a_context]['core'][$id] = $wp_meta_boxes[$page][$a_context]['default'][$id]; … … 948 953 return; 949 954 } 950 // If no priority given and id already present, use existing priority 955 // If no priority given and id already present, use existing priority. 951 956 if ( empty($priority) ) { 952 957 $priority = $a_priority; 953 // else if we're adding to the sorted priority, we don't know the title or callback. Grab them from the previously added context/priority. 958 /* 959 * Else, if we're adding to the sorted priority, we don't know the title 960 * or callback. Grab them from the previously added context/priority. 961 */ 954 962 } elseif ( 'sorted' == $priority ) { 955 963 $title = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['title']; … … 957 965 $callback_args = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['args']; 958 966 } 959 // An id can be in only one priority and one context 967 // An id can be in only one priority and one context. 960 968 if ( $priority != $a_priority || $context != $a_context ) 961 969 unset($wp_meta_boxes[$page][$a_context][$a_priority][$id]); … … 1341 1349 global $wp_settings_errors; 1342 1350 1343 // If $sanitize is true, manually re-run the sanitization for this option 1344 // This allows the $sanitize_callback from register_setting() to run, adding 1345 // any settings errors you want to show by default. 1351 /* 1352 * If $sanitize is true, manually re-run the sanitization for this option 1353 * This allows the $sanitize_callback from register_setting() to run, adding 1354 * any settings errors you want to show by default. 1355 */ 1346 1356 if ( $sanitize ) 1347 1357 sanitize_option( $setting, get_option( $setting ) ); 1348 1358 1349 // If settings were passed back from options.php then use them 1359 // If settings were passed back from options.php then use them. 1350 1360 if ( isset( $_GET['settings-updated'] ) && $_GET['settings-updated'] && get_transient( 'settings_errors' ) ) { 1351 1361 $wp_settings_errors = array_merge( (array) $wp_settings_errors, get_transient( 'settings_errors' ) ); … … 1353 1363 } 1354 1364 1355 // Check global in case errors have been added on this pageload 1365 // Check global in case errors have been added on this pageload. 1356 1366 if ( ! count( $wp_settings_errors ) ) 1357 1367 return array(); 1358 1368 1359 // Filter the results to those of a specific setting if one was set 1369 // Filter the results to those of a specific setting if one was set. 1360 1370 if ( $setting ) { 1361 1371 $setting_errors = array(); -
trunk/src/wp-admin/includes/update-core.php
r28085 r29206 1090 1090 } 1091 1091 1092 // generate the $sub_skip_list for the subdirectory as a sub-set of the existing $skip_list 1092 /* 1093 * Generate the $sub_skip_list for the subdirectory as a sub-set 1094 * of the existing $skip_list. 1095 */ 1093 1096 $sub_skip_list = array(); 1094 1097 foreach ( $skip_list as $skip_item ) { … … 1126 1129 return; 1127 1130 1128 // Load the updated default text localization domain for new strings 1131 // Load the updated default text localization domain for new strings. 1129 1132 load_default_textdomain(); 1130 1133 … … 1142 1145 <?php 1143 1146 1144 // Include admin-footer.php and exit 1147 // Include admin-footer.php and exit. 1145 1148 include(ABSPATH . 'wp-admin/admin-footer.php'); 1146 1149 exit(); -
trunk/src/wp-admin/includes/upgrade.php
r29154 r29206 62 62 update_option('default_pingback_flag', 0); 63 63 64 // Create default user. If the user already exists, the user tables are 65 // being shared among blogs. Just set the role in that case. 64 /* 65 * Create default user. If the user already exists, the user tables are 66 * being shared among blogs. Just set the role in that case. 67 */ 66 68 $user_id = username_exists($user_name); 67 69 $user_password = trim($user_password); … … 626 628 $active_plugins = __get_option('active_plugins'); 627 629 628 // If plugins are not stored in an array, they're stored in the old 629 // newline separated format. Convert to new format. 630 /* 631 * If plugins are not stored in an array, they're stored in the old 632 * newline separated format. Convert to new format. 633 */ 630 634 if ( !is_array( $active_plugins ) ) { 631 635 $active_plugins = explode("\n", trim($active_plugins)); … … 717 721 $wpdb->show_errors(); 718 722 719 // populate comment_count field of posts table723 // Populate comment_count field of posts table. 720 724 $comments = $wpdb->get_results( "SELECT comment_post_ID, COUNT(*) as c FROM $wpdb->comments WHERE comment_approved = '1' GROUP BY comment_post_ID" ); 721 725 if ( is_array( $comments ) ) … … 723 727 $wpdb->update( $wpdb->posts, array('comment_count' => $comment->c), array('ID' => $comment->comment_post_ID) ); 724 728 725 // Some alpha versions used a post status of object instead of attachment and put 726 // the mime type in post_type instead of post_mime_type. 729 /* 730 * Some alpha versions used a post status of object instead of attachment 731 * and put the mime type in post_type instead of post_mime_type. 732 */ 727 733 if ( $wp_current_db_version > 2541 && $wp_current_db_version <= 3091 ) { 728 734 $objects = $wpdb->get_results("SELECT ID, post_type FROM $wpdb->posts WHERE post_status = 'object'"); … … 881 887 // < 3570 we used linkcategories. >= 3570 we used categories and link2cat. 882 888 if ( $wp_current_db_version < 3570 ) { 883 // Create link_category terms for link categories. Create a map of link cat IDs 884 // to link_category terms. 889 /* 890 * Create link_category terms for link categories. Create a map of link 891 * cat IDs to link_category terms. 892 */ 885 893 $link_cat_id_map = array(); 886 894 $default_link_cat = 0; … … 990 998 */ 991 999 function upgrade_old_slugs() { 992 // upgrade people who were using the Redirect Old Slugs plugin1000 // Upgrade people who were using the Redirect Old Slugs plugin. 993 1001 global $wpdb; 994 1002 $wpdb->query("UPDATE $wpdb->postmeta SET meta_key = '_wp_old_slug' WHERE meta_key = 'old_slug'"); … … 1305 1313 global $wp_current_db_version, $wpdb; 1306 1314 1307 // Always 1315 // Always. 1308 1316 if ( is_main_network() ) { 1309 // Deletes all expired transients. 1310 // The multi-table delete syntax is used to delete the transient record from table a, 1311 // and the corresponding transient_timeout record from table b. 1317 /* 1318 * Deletes all expired transients. The multi-table delete syntax is used 1319 * to delete the transient record from table a, and the corresponding 1320 * transient_timeout record from table b. 1321 */ 1312 1322 $time = time(); 1313 1323 $sql = "DELETE a, b FROM $wpdb->sitemeta a, $wpdb->sitemeta b … … 1319 1329 } 1320 1330 1321 // 2.8 1331 // 2.8. 1322 1332 if ( $wp_current_db_version < 11549 ) { 1323 1333 $wpmu_sitewide_plugins = get_site_option( 'wpmu_sitewide_plugins' ); … … 1416 1426 return true; 1417 1427 } 1418 //didn't find it try to create it. 1428 1429 // Didn't find it try to create it.. 1419 1430 $wpdb->query($create_ddl); 1420 // we cannot directly tell that whether this succeeded! 1431 1432 // We cannot directly tell that whether this succeeded! 1421 1433 if ( $wpdb->get_var( $query ) == $table_name ) { 1422 1434 return true; … … 1479 1491 } 1480 1492 } 1481 //didn't find it try to create it. 1493 1494 // Didn't find it try to create it. 1482 1495 $wpdb->query($create_ddl); 1483 // we cannot directly tell that whether this succeeded! 1496 1497 // We cannot directly tell that whether this succeeded! 1484 1498 foreach ($wpdb->get_col("DESC $table_name", 0) as $column ) { 1485 1499 if ($column == $column_name) { … … 1552 1566 // Note: \\\ inside a regex denotes a single backslash. 1553 1567 1554 // Replace one or more backslashes followed by a single quote with 1555 // a single quote. 1568 /* 1569 * Replace one or more backslashes followed by a single quote with 1570 * a single quote. 1571 */ 1556 1572 $content = preg_replace("/\\\+'/", "'", $content); 1557 1573 1558 // Replace one or more backslashes followed by a double quote with 1559 // a double quote. 1574 /* 1575 * Replace one or more backslashes followed by a double quote with 1576 * a double quote. 1577 */ 1560 1578 $content = preg_replace('/\\\+"/', '"', $content); 1561 1579 … … 1656 1674 continue; 1657 1675 1658 // Clear the field and index arrays 1676 // Clear the field and index arrays. 1659 1677 $cfields = $indices = array(); 1660 // Get all of the field names in the query from between the parens 1678 1679 // Get all of the field names in the query from between the parentheses. 1661 1680 preg_match("|\((.*)\)|ms", $qry, $match2); 1662 1681 $qryline = trim($match2[1]); 1663 1682 1664 // Separate field lines into an array 1683 // Separate field lines into an array. 1665 1684 $flds = explode("\n", $qryline); 1666 1685 1686 // todo: Remove this? 1667 1687 //echo "<hr/><pre>\n".print_r(strtolower($table), true).":\n".print_r($cqueries, true)."</pre><hr/>"; 1668 1688 1669 // For every field line specified in the query 1689 // For every field line specified in the query. 1670 1690 foreach ($flds as $fld) { 1671 // Extract the field name 1691 1692 // Extract the field name. 1672 1693 preg_match("|^([^ ]*)|", trim($fld), $fvals); 1673 1694 $fieldname = trim( $fvals[1], '`' ); 1674 1695 1675 // Verify the found field name 1696 // Verify the found field name. 1676 1697 $validfield = true; 1677 1698 switch (strtolower($fieldname)) { … … 1688 1709 $fld = trim($fld); 1689 1710 1690 // If it's a valid field, add it to the field array 1711 // If it's a valid field, add it to the field array. 1691 1712 if ($validfield) { 1692 1713 $cfields[strtolower($fieldname)] = trim($fld, ", \n"); … … 1694 1715 } 1695 1716 1696 // For every field in the table 1717 // For every field in the table. 1697 1718 foreach ($tablefields as $tablefield) { 1698 // If the table field exists in the field array... 1719 1720 // If the table field exists in the field array ... 1699 1721 if (array_key_exists(strtolower($tablefield->Field), $cfields)) { 1700 // Get the field type from the query 1722 1723 // Get the field type from the query. 1701 1724 preg_match("|".$tablefield->Field." ([^ ]*( unsigned)?)|i", $cfields[strtolower($tablefield->Field)], $matches); 1702 1725 $fieldtype = $matches[1]; … … 1710 1733 1711 1734 // Get the default value from the array 1735 // todo: Remove this? 1712 1736 //echo "{$cfields[strtolower($tablefield->Field)]}<br>"; 1713 1737 if (preg_match("| DEFAULT '(.*?)'|i", $cfields[strtolower($tablefield->Field)], $matches)) { … … 1720 1744 } 1721 1745 1722 // Remove the field from the array (so it's not added) 1746 // Remove the field from the array (so it's not added). 1723 1747 unset($cfields[strtolower($tablefield->Field)]); 1724 1748 } else { … … 1727 1751 } 1728 1752 1729 // For every remaining field specified for the table 1753 // For every remaining field specified for the table. 1730 1754 foreach ($cfields as $fieldname => $fielddef) { 1731 // Push a query line into $cqueries that adds the field to that table 1755 // Push a query line into $cqueries that adds the field to that table. 1732 1756 $cqueries[] = "ALTER TABLE {$table} ADD COLUMN $fielddef"; 1733 1757 $for_update[$table.'.'.$fieldname] = 'Added column '.$table.'.'.$fieldname; 1734 1758 } 1735 1759 1736 // Index stuff goes here 1737 // Fetch the table index structure from the database 1760 // Index stuff goes here. Fetch the table index structure from the database. 1738 1761 $tableindices = $wpdb->get_results("SHOW INDEX FROM {$table};"); 1739 1762 1740 1763 if ($tableindices) { 1741 // Clear the index array 1764 // Clear the index array. 1742 1765 unset($index_ary); 1743 1766 1744 // For every index in the table 1767 // For every index in the table. 1745 1768 foreach ($tableindices as $tableindex) { 1746 // Add the index to the index data array 1769 1770 // Add the index to the index data array. 1747 1771 $keyname = $tableindex->Key_name; 1748 1772 $index_ary[$keyname]['columns'][] = array('fieldname' => $tableindex->Column_name, 'subpart' => $tableindex->Sub_part); … … 1750 1774 } 1751 1775 1752 // For each actual index in the index array 1776 // For each actual index in the index array. 1753 1777 foreach ($index_ary as $index_name => $index_data) { 1754 // Build a create string to compare to the query 1778 1779 // Build a create string to compare to the query. 1755 1780 $index_string = ''; 1756 1781 if ($index_name == 'PRIMARY') { … … 1764 1789 } 1765 1790 $index_columns = ''; 1766 // For each column in the index 1791 1792 // For each column in the index. 1767 1793 foreach ($index_data['columns'] as $column_data) { 1768 1794 if ($index_columns != '') $index_columns .= ','; 1769 // Add the field to the column list string 1795 1796 // Add the field to the column list string. 1770 1797 $index_columns .= $column_data['fieldname']; 1771 1798 if ($column_data['subpart'] != '') { … … 1773 1800 } 1774 1801 } 1775 // Add the column list to the index create string 1802 // Add the column list to the index create string. 1776 1803 $index_string .= ' ('.$index_columns.')'; 1777 1804 if (!(($aindex = array_search($index_string, $indices)) === false)) { 1778 1805 unset($indices[$aindex]); 1806 // todo: Remove this? 1779 1807 //echo "<pre style=\"border:1px solid #ccc;margin-top:5px;\">{$table}:<br />Found index:".$index_string."</pre>\n"; 1780 1808 } 1809 // todo: Remove this? 1781 1810 //else echo "<pre style=\"border:1px solid #ccc;margin-top:5px;\">{$table}:<br /><b>Did not find index:</b>".$index_string."<br />".print_r($indices, true)."</pre>\n"; 1782 1811 } 1783 1812 } 1784 1813 1785 // For every remaining index specified for the table 1814 // For every remaining index specified for the table. 1786 1815 foreach ( (array) $indices as $index ) { 1787 // Push a query line into $cqueries that adds the index to that table 1816 // Push a query line into $cqueries that adds the index to that table. 1788 1817 $cqueries[] = "ALTER TABLE {$table} ADD $index"; 1789 1818 $for_update[] = 'Added index ' . $table . ' ' . $index; 1790 1819 } 1791 1820 1792 // Remove the original table creation query from processing 1821 // Remove the original table creation query from processing. 1793 1822 unset( $cqueries[ $table ], $for_update[ $table ] ); 1794 1823 } … … 1797 1826 if ($execute) { 1798 1827 foreach ($allqueries as $query) { 1828 // todo: Remove this? 1799 1829 //echo "<pre style=\"border:1px solid #ccc;margin-top:5px;\">".print_r($query, true)."</pre>\n"; 1800 1830 $wpdb->query($query); … … 1848 1878 return false; 1849 1879 1850 // Copy files from the old locations to the site theme. 1851 // TODO: This does not copy arbitrary include dependencies. Only the 1852 // standard WP files are copied. 1880 /* 1881 * Copy files from the old locations to the site theme. 1882 * TODO: This does not copy arbitrary include dependencies. Only the standard WP files are copied. 1883 */ 1853 1884 $files = array('index.php' => 'index.php', 'wp-layout.css' => 'style.css', 'wp-comments.php' => 'comments.php', 'wp-comments-popup.php' => 'comments-popup.php'); 1854 1885 … … 1859 1890 $oldpath = ABSPATH; 1860 1891 1861 if ($oldfile == 'index.php') { // Check to make sure it's not a new index 1892 // Check to make sure it's not a new index. 1893 if ($oldfile == 'index.php') { 1862 1894 $index = implode('', file("$oldpath/$oldfile")); 1863 1895 if (strpos($index, 'WP_USE_THEMES') !== false) { 1864 1896 if (! @copy(WP_CONTENT_DIR . '/themes/' . WP_DEFAULT_THEME . '/index.php', "$site_dir/$newfile")) 1865 1897 return false; 1866 continue; // Don't copy anything 1898 1899 // Don't copy anything. 1900 continue; 1867 1901 } 1868 1902 } -
trunk/src/wp-admin/includes/user.php
r28500 r29206 391 391 function default_password_nag_handler($errors = false) { 392 392 global $user_ID; 393 if ( ! get_user_option('default_password_nag') ) //Short circuit it. 393 // Short-circuit it. 394 if ( ! get_user_option('default_password_nag') ) 394 395 return; 395 396 396 // get_user_setting = JS saved UI setting. else no-js-fallback code.397 // get_user_setting = JS saved UI setting. else no-js-fallback code. 397 398 if ( 'hide' == get_user_setting('default_password_nag') || isset($_GET['default_password_nag']) && '0' == $_GET['default_password_nag'] ) { 398 399 delete_user_setting('default_password_nag'); … … 402 403 403 404 add_action('profile_update', 'default_password_nag_edit_user', 10, 2); 405 404 406 /** 405 407 * @since 2.8.0 406 408 */ 407 409 function default_password_nag_edit_user($user_ID, $old_data) { 408 if ( ! get_user_option('default_password_nag', $user_ID) ) //Short circuit it. 410 // Short-circuit it. 411 if ( ! get_user_option('default_password_nag', $user_ID) ) 409 412 return; 410 413 411 414 $new_data = get_userdata($user_ID); 412 415 413 if ( $new_data->user_pass != $old_data->user_pass ) { //Remove the nag if the password has been changed. 416 // Remove the nag if the password has been changed. 417 if ( $new_data->user_pass != $old_data->user_pass ) { 414 418 delete_user_setting('default_password_nag'); 415 419 update_user_option($user_ID, 'default_password_nag', false, true); … … 418 422 419 423 add_action('admin_notices', 'default_password_nag'); 424 420 425 /** 421 426 * @since 2.8.0 … … 423 428 function default_password_nag() { 424 429 global $pagenow; 425 if ( 'profile.php' == $pagenow || ! get_user_option('default_password_nag') ) //Short circuit it. 430 // Short-circuit it. 431 if ( 'profile.php' == $pagenow || ! get_user_option('default_password_nag') ) 426 432 return; 427 433 -
trunk/src/wp-admin/includes/widgets.php
r28500 r29206 174 174 } 175 175 176 // We aren't showing a widget control, we're outputting a template for a multi-widget control 176 /* 177 * We aren't showing a widget control, we're outputting a template 178 * for a multi-widget control. 179 */ 177 180 if ( isset($sidebar_args['_display']) && 'template' == $sidebar_args['_display'] && $widget_number ) { 178 181 // number == -1 implies a template where id numbers are replaced by a generic '__i__' 179 182 $control['params'][0]['number'] = -1; 180 // with id_base widget id's are constructed like {$id_base}-{$id_number}183 // With id_base widget id's are constructed like {$id_base}-{$id_number}. 181 184 if ( isset($control['id_base']) ) 182 185 $id_format = $control['id_base'] . '-__i__'; -
trunk/src/wp-admin/install-helper.php
r27262 r29206 58 58 } 59 59 } 60 // didn't find ittry to create it.60 // Didn't find it, so try to create it. 61 61 $wpdb->query($create_ddl); 62 // we cannot directly tell that whether this succeeded! 62 63 // We cannot directly tell that whether this succeeded! 63 64 foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) { 64 65 if ($table == $table_name) { … … 91 92 } 92 93 } 93 //didn't find it try to create it. 94 95 // Didn't find it, so try to create it. 94 96 $wpdb->query($create_ddl); 95 // we cannot directly tell that whether this succeeded! 97 98 // We cannot directly tell that whether this succeeded! 96 99 foreach ($wpdb->get_col("DESC $table_name",0) as $column ) { 97 100 if ($column == $column_name) { … … 119 122 foreach ($wpdb->get_col("DESC $table_name",0) as $column ) { 120 123 if ($column == $column_name) { 121 //found it try to drop it. 124 125 // Found it, so try to drop it. 122 126 $wpdb->query($drop_ddl); 123 // we cannot directly tell that whether this succeeded! 127 128 // We cannot directly tell that whether this succeeded! 124 129 foreach ($wpdb->get_col("DESC $table_name",0) as $column ) { 125 130 if ($column == $column_name) { … … 129 134 } 130 135 } 131 // else didn't find it136 // Else didn't find it. 132 137 return true; 133 138 } … … 168 173 169 174 if ($row->Field == $col_name) { 170 // got our column, check the params 175 176 // Got our column, check the params. 171 177 if (($col_type != null) && ($row->Type != $col_type)) { 172 178 ++$diffs; -
trunk/src/wp-admin/install.php
r29030 r29206 223 223 $admin_email = isset( $_POST['admin_email'] ) ?trim( wp_unslash( $_POST['admin_email'] ) ) : ''; 224 224 $public = isset( $_POST['blog_public'] ) ? (int) $_POST['blog_public'] : 0; 225 // check e-mail address 225 226 // Check e-mail address. 226 227 $error = false; 227 228 if ( empty( $user_name ) ) { -
trunk/src/wp-admin/link-parse-opml.php
r28786 r29206 46 46 $url = $attrs['HTMLURL']; 47 47 } 48 // save the data away. 48 49 // Save the data away. 49 50 $names[] = $name; 50 51 $urls[] = $url; … … 52 53 $feeds[] = isset( $attrs['XMLURL'] ) ? $attrs['XMLURL'] : ''; 53 54 $descriptions[] = isset( $attrs['DESCRIPTION'] ) ? $attrs['DESCRIPTION'] : ''; 54 } // end if outline55 } // End if outline. 55 56 } 56 57 … … 65 66 */ 66 67 function endElement($parser, $tagName) { 67 // nothing to do.68 // Nothing to do. 68 69 } 69 70 -
trunk/src/wp-admin/link.php
r28307 r29206 31 31 check_admin_referer('bulk-bookmarks'); 32 32 33 // for each link id (in $linkcheck[]) change category to selected value33 // For each link id (in $linkcheck[]) change category to selected value. 34 34 if (count($linkcheck) == 0) { 35 35 wp_redirect($this_file); … … 51 51 check_admin_referer('bulk-bookmarks'); 52 52 53 // for each link id (in $linkcheck[]) change category to selected value53 // For each link id (in $linkcheck[]) change category to selected value. 54 54 if (count($linkcheck) == 0) { 55 55 wp_redirect($this_file); … … 57 57 } 58 58 $all_links = join(',', $linkcheck); 59 // should now have an array of links we can change 60 //$q = $wpdb->query("update $wpdb->links SET link_category='$category' WHERE link_id IN ($all_links)"); 59 /* 60 * Should now have an array of links we can change: 61 * $q = $wpdb->query("update $wpdb->links SET link_category='$category' WHERE link_id IN ($all_links)"); 62 */ 61 63 62 64 wp_redirect($this_file); -
trunk/src/wp-admin/media-upload.php
r26917 r29206 31 31 $post_id = isset($post_id)? (int) $post_id : 0; 32 32 33 // Require an ID for the edit screen 33 // Require an ID for the edit screen. 34 34 if ( isset($action) && $action == 'edit' && !$ID ) 35 35 wp_die( __( 'Cheatin’ uh?' ) ); … … 38 38 wp_die( __( 'Cheatin’ uh?' ) ); 39 39 40 // upload type: image, video, file, ..?40 // Upload type: image, video, file, ..? 41 41 if ( isset($_GET['type']) ) { 42 42 $type = strval($_GET['type']); … … 53 53 } 54 54 55 // tab: gallery, library, or type-specific55 // Tab: gallery, library, or type-specific. 56 56 if ( isset($_GET['tab']) ) { 57 57 $tab = strval($_GET['tab']); … … 69 69 $body_id = 'media-upload'; 70 70 71 // let the action code decide how to handle the request71 // Let the action code decide how to handle the request. 72 72 if ( $tab == 'type' || $tab == 'type_url' || ! array_key_exists( $tab , media_upload_tabs() ) ) { 73 73 /** -
trunk/src/wp-admin/media.php
r28633 r29206 41 41 } 42 42 43 // no break43 // No break. 44 44 case 'edit' : 45 45 $title = __('Edit Media'); -
trunk/src/wp-admin/menu-header.php
r29083 r29206 81 81 $img_class = ' dashicons-before'; 82 82 83 // if the string 'none' (previously 'div') is passed instead of an URL, don't output the default menu image 84 // so an icon can be added to div.wp-menu-image as background with CSS. 85 // Dashicons and base64-encoded data:image/svg_xml URIs are also handled as special cases. 83 /* 84 * If the string 'none' (previously 'div') is passed instead of an URL, don't output 85 * the default menu image so an icon can be added to div.wp-menu-image as background 86 * with CSS. Dashicons and base64-encoded data:image/svg_xml URIs are also handled 87 * as special cases. 88 */ 86 89 if ( ! empty( $item[6] ) ) { 87 90 $img = '<img src="' . $item[6] . '" alt="" />'; -
trunk/src/wp-admin/menu.php
r29170 r29206 122 122 } 123 123 124 // if $ptype_menu_position is already populated or will be populated by a hard-coded value below, increment the position. 124 /* 125 * If $ptype_menu_position is already populated or will be populated 126 * by a hard-coded value below, increment the position. 127 */ 125 128 $core_menu_positions = array(59, 60, 65, 70, 75, 80, 85, 99); 126 129 while ( isset($menu[$ptype_menu_position]) || in_array($ptype_menu_position, $core_menu_positions) ) -
trunk/src/wp-admin/nav-menus.php
r28205 r29206 54 54 break; 55 55 case 'move-down-menu-item' : 56 // moving down a menu item is the same as moving up the next in order 56 57 // Moving down a menu item is the same as moving up the next in order. 57 58 check_admin_referer( 'move-menu_item' ); 58 59 $menu_item_id = isset( $_REQUEST['menu-item'] ) ? (int) $_REQUEST['menu-item'] : 0; … … 64 65 $menu_item_data = (array) wp_setup_nav_menu_item( get_post( $menu_item_id ) ); 65 66 66 // set up the data we need in one pass through the array of menu items67 // Set up the data we need in one pass through the array of menu items. 67 68 $dbids_to_orders = array(); 68 69 $orders_to_dbids = array(); … … 76 77 } 77 78 78 // get next in order79 // Get next in order. 79 80 if ( 80 81 isset( $orders_to_dbids[$dbids_to_orders[$menu_item_id] + 1] ) … … 83 84 $next_item_data = (array) wp_setup_nav_menu_item( get_post( $next_item_id ) ); 84 85 85 // if not siblings of same parent, bubble menu item up but keep order86 // If not siblings of same parent, bubble menu item up but keep order. 86 87 if ( 87 88 ! empty( $menu_item_data['menu_item_parent'] ) && … … 103 104 } 104 105 105 // make menu item a child of its next sibling106 // Make menu item a child of its next sibling. 106 107 } else { 107 108 $next_item_data['menu_order'] = $next_item_data['menu_order'] - 1; … … 115 116 } 116 117 117 // the item is last but still has a parent, so bubble up118 // The item is last but still has a parent, so bubble up. 118 119 } elseif ( 119 120 ! empty( $menu_item_data['menu_item_parent'] ) && … … 137 138 $menu_item_data = (array) wp_setup_nav_menu_item( get_post( $menu_item_id ) ); 138 139 139 // set up the data we need in one pass through the array of menu items140 // Set up the data we need in one pass through the array of menu items. 140 141 $dbids_to_orders = array(); 141 142 $orders_to_dbids = array(); … … 149 150 } 150 151 151 // if this menu item is not first152 // If this menu item is not first. 152 153 if ( ! empty( $dbids_to_orders[$menu_item_id] ) && ! empty( $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1] ) ) { 153 154 154 // if this menu item is a child of the previous155 // If this menu item is a child of the previous. 155 156 if ( 156 157 ! empty( $menu_item_data['menu_item_parent'] ) && … … 165 166 $parent_data = (array) $parent_object; 166 167 167 // if there is something before the parent and parent a child of it, make menu item a child also of it 168 /* 169 * If there is something before the parent and parent a child of it, 170 * make menu item a child also of it. 171 */ 168 172 if ( 169 173 ! empty( $dbids_to_orders[$parent_db_id] ) && … … 173 177 $menu_item_data['menu_item_parent'] = $parent_data['menu_item_parent']; 174 178 175 // else if there is something before parent and parent not a child of it, make menu item a child of that something's parent 179 /* 180 * Else if there is something before parent and parent not a child of it, 181 * make menu item a child of that something's parent 182 */ 176 183 } elseif ( 177 184 ! empty( $dbids_to_orders[$parent_db_id] ) && … … 184 191 $menu_item_data['menu_item_parent'] = 0; 185 192 186 // else there isn't something before the parent193 // Else there isn't something before the parent. 187 194 } else { 188 195 $menu_item_data['menu_item_parent'] = 0; 189 196 } 190 197 191 // set former parent's [menu_order] to that of menu-item's198 // Set former parent's [menu_order] to that of menu-item's. 192 199 $parent_data['menu_order'] = $parent_data['menu_order'] + 1; 193 200 194 // set menu-item's [menu_order] to that of former parent201 // Set menu-item's [menu_order] to that of former parent. 195 202 $menu_item_data['menu_order'] = $menu_item_data['menu_order'] - 1; 196 203 197 // save changes204 // Save changes. 198 205 update_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] ); 199 206 wp_update_post($menu_item_data); … … 201 208 } 202 209 203 // else this menu item is not a child of the previous210 // Else this menu item is not a child of the previous. 204 211 } elseif ( 205 212 empty( $menu_item_data['menu_order'] ) || … … 209 216 $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1] != $menu_item_data['menu_item_parent'] 210 217 ) { 211 // just make it a child of the previous; keep the order218 // Just make it a child of the previous; keep the order. 212 219 $menu_item_data['menu_item_parent'] = (int) $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1]; 213 220 update_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] ); … … 233 240 $deletion = wp_delete_nav_menu( $nav_menu_selected_id ); 234 241 } else { 235 // Reset the selected menu 242 // Reset the selected menu. 236 243 $nav_menu_selected_id = 0; 237 244 unset( $_REQUEST['menu'] ); … … 267 274 check_admin_referer( 'update-nav_menu', 'update-nav-menu-nonce' ); 268 275 269 // Remove menu locations that have been unchecked 276 // Remove menu locations that have been unchecked. 270 277 foreach ( $locations as $location => $description ) { 271 278 if ( ( empty( $_POST['menu-locations'] ) || empty( $_POST['menu-locations'][ $location ] ) ) && isset( $menu_locations[ $location ] ) && $menu_locations[ $location ] == $nav_menu_selected_id ) … … 273 280 } 274 281 275 // Merge new and existing menu locations if any new ones are set 282 // Merge new and existing menu locations if any new ones are set. 276 283 if ( isset( $_POST['menu-locations'] ) ) { 277 284 $new_menu_locations = array_map( 'absint', $_POST['menu-locations'] ); … … 279 286 } 280 287 281 // Set menu locations 288 // Set menu locations. 282 289 set_theme_mod( 'nav_menu_locations', $menu_locations ); 283 290 284 // Add Menu 291 // Add Menu. 285 292 if ( 0 == $nav_menu_selected_id ) { 286 293 $new_menu_title = trim( esc_html( $_POST['menu-name'] ) ); … … 315 322 set_theme_mod( 'nav_menu_locations', $menu_locations ); 316 323 } 324 317 325 // $messages[] = '<div id="message" class="updated"><p>' . sprintf( __( '<strong>%s</strong> has been created.' ), $nav_menu_selected_title ) . '</p></div>'; 318 326 wp_redirect( admin_url( 'nav-menus.php?menu=' . $_nav_menu_selected_id ) ); … … 323 331 } 324 332 325 // Update existing menu 333 // Update existing menu. 326 334 } else { 327 335 … … 345 353 } 346 354 347 // Update menu items 355 // Update menu items. 348 356 if ( ! is_wp_error( $_menu_object ) ) { 349 357 $messages = array_merge( $messages, wp_nav_menu_update_menu_items( $nav_menu_selected_id, $nav_menu_selected_title ) ); … … 372 380 } 373 381 374 // Get all nav menus 382 // Get all nav menus. 375 383 $nav_menus = wp_get_nav_menus( array('orderby' => 'name') ); 376 384 $menu_count = count( $nav_menus ); … … 381 389 $locations_screen = ( isset( $_GET['action'] ) && 'locations' == $_GET['action'] ) ? true : false; 382 390 383 // If we have one theme location, and zero menus, we take them right into editing their first menu 391 /* 392 * If we have one theme location, and zero menus, we take them right 393 * into editing their first menu. 394 */ 384 395 $page_count = wp_count_posts( 'page' ); 385 396 $one_theme_location_no_menus = ( 1 == count( get_registered_nav_menus() ) && ! $add_new_screen && empty( $nav_menus ) && ! empty( $page_count->publish ) ) ? true : false; … … 405 416 wp_localize_script( 'nav-menu', 'menus', $nav_menus_l10n ); 406 417 407 // Redirect to add screen if there are no menus and this users has either zero, or more than 1 theme locations 418 /* 419 * Redirect to add screen if there are no menus and this users has either zero, 420 * or more than 1 theme locations. 421 */ 408 422 if ( 0 == $menu_count && ! $add_new_screen && ! $one_theme_location_no_menus ) 409 423 wp_redirect( admin_url( 'nav-menus.php?action=edit&menu=0' ) ); 410 424 411 // Get recently edited nav menu 425 // Get recently edited nav menu. 412 426 $recently_edited = absint( get_user_option( 'nav_menu_recently_edited' ) ); 413 427 if ( empty( $recently_edited ) && is_nav_menu( $nav_menu_selected_id ) ) 414 428 $recently_edited = $nav_menu_selected_id; 415 429 416 // Use $recently_edited if none are selected 430 // Use $recently_edited if none are selected. 417 431 if ( empty( $nav_menu_selected_id ) && ! isset( $_GET['menu'] ) && is_nav_menu( $recently_edited ) ) 418 432 $nav_menu_selected_id = $recently_edited; 419 433 420 // On deletion of menu, if another menu exists, show it 434 // On deletion of menu, if another menu exists, show it. 421 435 if ( ! $add_new_screen && 0 < $menu_count && isset( $_GET['action'] ) && 'delete' == $_GET['action'] ) 422 436 $nav_menu_selected_id = $nav_menus[0]->term_id; 423 437 424 // Set $nav_menu_selected_id to 0 if no menus 438 // Set $nav_menu_selected_id to 0 if no menus. 425 439 if ( $one_theme_location_no_menus ) { 426 440 $nav_menu_selected_id = 0; 427 441 } elseif ( empty( $nav_menu_selected_id ) && ! empty( $nav_menus ) && ! $add_new_screen ) { 428 // if we have no selection yet, and we have menus, set to the first one in the list 442 // if we have no selection yet, and we have menus, set to the first one in the list. 429 443 $nav_menu_selected_id = $nav_menus[0]->term_id; 430 444 } 431 445 432 // Update the user's setting 446 // Update the user's setting. 433 447 if ( $nav_menu_selected_id != $recently_edited && is_nav_menu( $nav_menu_selected_id ) ) 434 448 update_user_meta( $current_user->ID, 'nav_menu_recently_edited', $nav_menu_selected_id ); … … 440 454 } 441 455 442 // Generate truncated menu names 456 // Generate truncated menu names. 443 457 foreach( (array) $nav_menus as $key => $_nav_menu ) { 444 458 $nav_menus[$key]->truncated_name = wp_html_excerpt( $_nav_menu->name, 40, '…' ); 445 459 } 446 460 447 // Retrieve menu locations 461 // Retrieve menu locations. 448 462 if ( current_theme_supports( 'menus' ) ) { 449 463 $locations = get_registered_nav_menus(); … … 451 465 } 452 466 453 // Ensure the user will be able to scroll horizontally 454 // by adding a class for the max menu depth. 467 /* 468 * Ensure the user will be able to scroll horizontally 469 * by adding a class for the max menu depth. 470 */ 455 471 global $_wp_nav_menu_max_depth; 456 472 $_wp_nav_menu_max_depth = 0; 457 473 458 // Calling wp_get_nav_menu_to_edit generates $_wp_nav_menu_max_depth 474 // Calling wp_get_nav_menu_to_edit generates $_wp_nav_menu_max_depth. 459 475 if ( is_nav_menu( $nav_menu_selected_id ) ) { 460 476 $menu_items = wp_get_nav_menu_items( $nav_menu_selected_id, array( 'post_status' => 'any' ) ); … … 511 527 'content' => $editing_menus 512 528 ) ); 513 else : // Locations Tab 529 else : // Locations Tab. 514 530 $locations_overview = '<p>' . __( 'This screen is used for globally assigning menus to locations defined by your theme.' ) . '</p>'; 515 531 $locations_overview .= '<ul><li>' . __( 'To assign menus to one or more theme locations, <strong>select a menu from each location’s drop down.</strong> When you’re finished, <strong>click Save Changes</strong>' ) . '</li>'; … … 530 546 ); 531 547 532 // Get the admin header 548 // Get the admin header. 533 549 require_once( ABSPATH . 'wp-admin/admin-header.php' ); 534 550 ?> … … 645 661 $assigned_locations = array_slice( $locations_assigned_to_this_menu, 0, absint( apply_filters( 'wp_nav_locations_listed_per_menu', 3 ) ) ); 646 662 647 // Adds ellipses following the number of locations defined in $assigned_locations 663 // Adds ellipses following the number of locations defined in $assigned_locations. 648 664 if ( ! empty( $assigned_locations ) ) { 649 665 printf( ' (%1$s%2$s)', -
trunk/src/wp-admin/network.php
r28906 r29206 534 534 535 535 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 536 // create network tables536 // Create network tables. 537 537 install_network(); 538 538 $base = parse_url( trailingslashit( get_option( 'home' ) ), PHP_URL_PATH ); -
trunk/src/wp-admin/network/site-info.php
r28643 r29206 60 60 } 61 61 62 // rewrite rules can't be flushed during switch to blog62 // Rewrite rules can't be flushed during switch to blog. 63 63 delete_option( 'rewrite_rules' ); 64 64 65 // update blogs table65 // Update blogs table. 66 66 $blog_data = wp_unslash( $_POST['blog'] ); 67 67 $existing_details = get_blog_details( $id, false ); -
trunk/src/wp-admin/options.php
r29007 r29206 217 217 if ( is_serialized( $option->option_value ) ) { 218 218 if ( is_serialized_string( $option->option_value ) ) { 219 // this is a serialized string, so we should display it219 // This is a serialized string, so we should display it. 220 220 $value = maybe_unserialize( $option->option_value ); 221 221 $options_to_update[] = $option->option_name; -
trunk/src/wp-admin/press-this.php
r27772 r29206 41 41 if ( !empty($_POST['photo_src']) && current_user_can('upload_files') ) { 42 42 foreach( (array) $_POST['photo_src'] as $key => $image) { 43 // see if files exist in content - we don't want to upload non-used selected files.43 // See if files exist in content - we don't want to upload non-used selected files. 44 44 if ( strpos($_POST['content'], htmlspecialchars($image)) !== false ) { 45 45 $desc = isset($_POST['photo_description'][$key]) ? $_POST['photo_description'][$key] : ''; … … 52 52 } 53 53 } 54 // set the post_content and status54 // Set the post_content and status. 55 55 $post['post_content'] = $content; 56 56 if ( isset( $_POST['publish'] ) && current_user_can( 'publish_posts' ) ) … … 61 61 $post['post_status'] = 'draft'; 62 62 63 // error handling for media_sideload63 // Error handling for media_sideload. 64 64 if ( is_wp_error($upload) ) { 65 65 wp_delete_post($post_ID); 66 66 wp_die($upload); 67 67 } else { 68 // Post formats 68 // Post formats. 69 69 if ( isset( $_POST['post_format'] ) ) { 70 70 if ( current_theme_supports( 'post-formats', $_POST['post_format'] ) ) … … 182 182 $sources = array(); 183 183 foreach ($matches[3] as $src) { 184 // if no http in url 184 185 // If no http in URL. 185 186 if (strpos($src, 'http') === false) 186 // if it doesn't have a relative uri187 // If it doesn't have a relative URI. 187 188 if ( strpos($src, '../') === false && strpos($src, './') === false && strpos($src, '/') === 0) 188 189 $src = 'http://'.str_replace('//','/', $host['host'].'/'.$src); … … 198 199 199 200 case 'photo_js': ?> 200 // gather images and load some default JS201 // Gather images and load some default JS. 201 202 var last = null 202 203 var img, img_tag, aspect, w, h, skip, i, strtoappend = ""; … … 439 440 } 440 441 jQuery(document).ready(function($) { 441 // resize screen442 // Resize screen. 442 443 window.resizeTo(760,580); 443 // set button actions 444 445 // Set button actions. 444 446 jQuery('#photo_button').click(function() { show('photo'); return false; }); 445 447 jQuery('#video_button').click(function() { show('video'); return false; }); 446 // auto select 448 449 // Auto select. 447 450 <?php if ( preg_match("/youtube\.com\/watch/i", $url) ) { ?> 448 451 show('video'); -
trunk/src/wp-admin/setup-config.php
r29058 r29206 301 301 <?php 302 302 else : 303 // If this file doesn't exist, then we are using the wp-config-sample.php 304 // file one level up, which is for the develop repo. 303 /* 304 * If this file doesn't exist, then we are using the wp-config-sample.php 305 * file one level up, which is for the develop repo. 306 */ 305 307 if ( file_exists( ABSPATH . 'wp-config-sample.php' ) ) 306 308 $path_to_wp_config = ABSPATH . 'wp-config.php'; -
trunk/src/wp-admin/theme-editor.php
r28500 r29206 82 82 $location = 'theme-editor.php?file=' . urlencode( $relative_file ) . '&theme=' . urlencode( $stylesheet ) . '&scrollto=' . $scrollto; 83 83 if ( is_writeable( $file ) ) { 84 // is_writable() not always reliable, check return value. see comments @ http://uk.php.net/is_writable84 // is_writable() not always reliable, check return value. see comments @ http://uk.php.net/is_writable 85 85 $f = fopen( $file, 'w+' ); 86 86 if ( $f !== false ) { -
trunk/src/wp-admin/update-core.php
r28530 r29206 541 541 check_admin_referer('upgrade-core'); 542 542 543 // do the (un)dismiss actions before headers, 544 // so that they can redirect 543 // Do the (un)dismiss actions before headers, so that they can redirect. 545 544 if ( isset( $_POST['dismiss'] ) ) 546 545 do_dismiss_core_update(); -
trunk/src/wp-admin/widgets.php
r27823 r29206 142 142 $sidebar = isset($sidebars_widgets[$sidebar_id]) ? $sidebars_widgets[$sidebar_id] : array(); 143 143 144 // delete144 // Delete. 145 145 if ( isset($_POST['removewidget']) && $_POST['removewidget'] ) { 146 146 … … 169 169 $sidebars_widgets[$sidebar_id] = $sidebar; 170 170 171 // remove old position171 // Remove old position. 172 172 if ( !isset($_POST['delete_widget']) ) { 173 173 foreach ( $sidebars_widgets as $key => $sb ) { … … 225 225 $id_base = isset($control['id_base']) ? $control['id_base'] : $control['id']; 226 226 227 // show the widget form227 // Show the widget form. 228 228 $width = ' style="width:' . max($control['width'], 350) . 'px"'; 229 229 $key = isset($_GET['key']) ? (int) $_GET['key'] : 0;
Note: See TracChangeset
for help on using the changeset viewer.