Changeset 56174
- Timestamp:
- 07/09/2023 07:50:52 PM (21 months ago)
- Location:
- trunk/src/wp-admin/includes
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ajax-actions.php
r56031 r56174 299 299 $return = array(); 300 300 301 // Check the type of request. 302 // Current allowed values are `add` and `search`. 301 /* 302 * Check the type of request. 303 * Current allowed values are `add` and `search`. 304 */ 303 305 if ( isset( $_REQUEST['autocomplete_type'] ) && 'search' === $_REQUEST['autocomplete_type'] ) { 304 306 $type = $_REQUEST['autocomplete_type']; … … 307 309 } 308 310 309 // Check the desired field for value. 310 // Current allowed values are `user_email` and `user_login`. 311 /* 312 * Check the desired field for value. 313 * Current allowed values are `user_email` and `user_login`. 314 */ 311 315 if ( isset( $_REQUEST['autocomplete_field'] ) && 'user_email' === $_REQUEST['autocomplete_field'] ) { 312 316 $field = $_REQUEST['autocomplete_field']; … … 1521 1525 require_once ABSPATH . 'wp-admin/includes/nav-menu.php'; 1522 1526 1523 // For performance reasons, we omit some object properties from the checklist. 1524 // The following is a hacky way to restore them when adding non-custom items. 1527 /* 1528 * For performance reasons, we omit some object properties from the checklist. 1529 * The following is a hacky way to restore them when adding non-custom items. 1530 */ 1525 1531 $menu_items_data = array(); 1526 1532 … … 2513 2519 } 2514 2520 2515 // Set a custom header with the attachment_id. 2516 // Used by the browser/client to resume creating image sub-sizes after a PHP fatal error. 2521 /* 2522 * Set a custom header with the attachment_id. 2523 * Used by the browser/client to resume creating image sub-sizes after a PHP fatal error. 2524 */ 2517 2525 if ( ! headers_sent() ) { 2518 2526 header( 'X-WP-Upload-Attachment-ID: ' . $attachment_id ); 2519 2527 } 2520 2528 2521 // This can still be pretty slow and cause timeout or out of memory errors. 2522 // The js that handles the response would need to also handle HTTP 500 errors. 2529 /* 2530 * This can still be pretty slow and cause timeout or out of memory errors. 2531 * The js that handles the response would need to also handle HTTP 500 errors. 2532 */ 2523 2533 wp_update_image_subsizes( $attachment_id ); 2524 2534 … … 3770 3780 3771 3781 if ( is_ssl() && str_starts_with( $url, 'http://' ) ) { 3772 // Admin is ssl and the user pasted non-ssl URL. 3773 // Check if the provider supports ssl embeds and use that for the preview. 3782 /* 3783 * Admin is ssl and the user pasted non-ssl URL. 3784 * Check if the provider supports ssl embeds and use that for the preview. 3785 */ 3774 3786 $ssl_shortcode = preg_replace( '%^(\\[embed[^\\]]*\\])http://%i', '$1https://', $shortcode ); 3775 3787 $parsed = $wp_embed->run_shortcode( $ssl_shortcode ); -
trunk/src/wp-admin/includes/class-core-upgrader.php
r55990 r56174 124 124 $download = $this->download_package( $current->packages->$to_download, true ); 125 125 126 // Allow for signature soft-fail. 127 // WARNING: This may be removed in the future. 126 /* 127 * Allow for signature soft-fail. 128 * WARNING: This may be removed in the future. 129 */ 128 130 if ( is_wp_error( $download ) && $download->get_error_data( 'softfail-filename' ) ) { 129 131 // Output the failure error as a normal feedback, and not as an error: -
trunk/src/wp-admin/includes/class-plugin-upgrader.php
r55911 r56174 213 213 add_filter( 'upgrader_clear_destination', array( $this, 'delete_old_plugin' ), 10, 4 ); 214 214 add_filter( 'upgrader_post_install', array( $this, 'active_after' ), 10, 2 ); 215 // There's a Trac ticket to move up the directory for zips which are made a bit differently, useful for non-.org plugins. 216 // 'source_selection' => array( $this, 'source_selection' ), 215 /* 216 * There's a Trac ticket to move up the directory for zips which are made a bit differently, useful for non-.org plugins. 217 * 'source_selection' => array( $this, 'source_selection' ), 218 */ 217 219 if ( $parsed_args['clear_update_cache'] ) { 218 220 // Clear cache so wp_update_plugins() knows about the new plugin. … … 253 255 wp_clean_plugins_cache( $parsed_args['clear_update_cache'] ); 254 256 255 // Ensure any future auto-update failures trigger a failure email by removing 256 // the last failure notification from the list when plugins update successfully. 257 /* 258 * Ensure any future auto-update failures trigger a failure email by removing 259 * the last failure notification from the list when plugins update successfully. 260 */ 257 261 $past_failure_emails = get_option( 'auto_plugin_theme_update_emails', array() ); 258 262 … … 390 394 remove_filter( 'upgrader_clear_destination', array( $this, 'delete_old_plugin' ) ); 391 395 392 // Ensure any future auto-update failures trigger a failure email by removing 393 // the last failure notification from the list when plugins update successfully. 396 /* 397 * Ensure any future auto-update failures trigger a failure email by removing 398 * the last failure notification from the list when plugins update successfully. 399 */ 394 400 $past_failure_emails = get_option( 'auto_plugin_theme_update_emails', array() ); 395 401 … … 652 658 } 653 659 654 // If plugin is in its own directory, recursively delete the directory. 655 // Base check on if plugin includes directory separator AND that it's not the root plugin folder. 660 /* 661 * If plugin is in its own directory, recursively delete the directory. 662 * Base check on if plugin includes directory separator AND that it's not the root plugin folder. 663 */ 656 664 if ( strpos( $plugin, '/' ) && $this_plugin_dir !== $plugins_dir ) { 657 665 $deleted = $wp_filesystem->delete( $this_plugin_dir, true ); -
trunk/src/wp-admin/includes/class-theme-upgrader.php
r55911 r56174 352 352 wp_clean_themes_cache( $parsed_args['clear_update_cache'] ); 353 353 354 // Ensure any future auto-update failures trigger a failure email by removing 355 // the last failure notification from the list when themes update successfully. 354 /* 355 * Ensure any future auto-update failures trigger a failure email by removing 356 * the last failure notification from the list when themes update successfully. 357 */ 356 358 $past_failure_emails = get_option( 'auto_plugin_theme_update_emails', array() ); 357 359 … … 493 495 remove_filter( 'upgrader_clear_destination', array( $this, 'delete_old_theme' ) ); 494 496 495 // Ensure any future auto-update failures trigger a failure email by removing 496 // the last failure notification from the list when themes update successfully. 497 /* 498 * Ensure any future auto-update failures trigger a failure email by removing 499 * the last failure notification from the list when themes update successfully. 500 */ 497 501 $past_failure_emails = get_option( 'auto_plugin_theme_update_emails', array() ); 498 502 -
trunk/src/wp-admin/includes/class-wp-automatic-updater.php
r56124 r56174 471 471 || 'locked' === $upgrade_result->get_error_code() ) 472 472 ) { 473 // These aren't actual errors, treat it as a skipped-update instead 474 // to avoid triggering the post-core update failure routines. 473 /* 474 * These aren't actual errors, treat it as a skipped-update instead 475 * to avoid triggering the post-core update failure routines. 476 */ 475 477 return false; 476 478 } … … 549 551 } 550 552 551 // Clean up, and check for any pending translations. 552 // (Core_Upgrader checks for core updates.) 553 /* 554 * Clean up, and check for any pending translations. 555 * (Core_Upgrader checks for core updates.) 556 */ 553 557 $theme_stats = array(); 554 558 if ( isset( $this->update_results['theme'] ) ) { … … 639 643 $error_code = $result->get_error_code(); 640 644 641 // Any of these WP_Error codes are critical failures, as in they occurred after we started to copy core files. 642 // We should not try to perform a background update again until there is a successful one-click update performed by the user. 645 /* 646 * Any of these WP_Error codes are critical failures, as in they occurred after we started to copy core files. 647 * We should not try to perform a background update again until there is a successful one-click update performed by the user. 648 */ 643 649 $critical = false; 644 650 if ( 'disk_full' === $error_code || str_contains( $error_code, '__copy_dir' ) ) { … … 832 838 $body .= "\n\n"; 833 839 834 // Don't show this message if there is a newer version available. 835 // Potential for confusion, and also not useful for them to know at this point. 840 /* 841 * Don't show this message if there is a newer version available. 842 * Potential for confusion, and also not useful for them to know at this point. 843 */ 836 844 if ( 'fail' === $type && ! $newer_version_available ) { 837 845 $body .= __( 'An attempt was made, but your site could not be updated automatically.' ) . ' '; … … 904 912 $body .= ' ' . __( 'Your hosting company, support forum volunteers, or a friendly developer may be able to use this information to help you:' ); 905 913 906 // If we had a rollback and we're still critical, then the rollback failed too. 907 // Loop through all errors (the main WP_Error, the update result, the rollback result) for code, data, etc. 914 /* 915 * If we had a rollback and we're still critical, then the rollback failed too. 916 * Loop through all errors (the main WP_Error, the update result, the rollback result) for code, data, etc. 917 */ 908 918 if ( 'rollback_was_required' === $result->get_error_code() ) { 909 919 $errors = array( $result, $result->get_error_data()->update, $result->get_error_data()->rollback ); -
trunk/src/wp-admin/includes/class-wp-debug-data.php
r56079 r56174 1620 1620 } 1621 1621 1622 // The max_execution_time defaults to 0 when PHP runs from cli. 1623 // We still want to limit it below. 1622 /* 1623 * The max_execution_time defaults to 0 when PHP runs from cli. 1624 * We still want to limit it below. 1625 */ 1624 1626 if ( empty( $max_execution_time ) ) { 1625 1627 $max_execution_time = 30; // 30 seconds. … … 1627 1629 1628 1630 if ( $max_execution_time > 20 ) { 1629 // If the max_execution_time is set to lower than 20 seconds, reduce it a bit to prevent 1630 // edge-case timeouts that may happen after the size loop has finished running. 1631 /* 1632 * If the max_execution_time is set to lower than 20 seconds, reduce it a bit to prevent 1633 * edge-case timeouts that may happen after the size loop has finished running. 1634 */ 1631 1635 $max_execution_time -= 2; 1632 1636 } 1633 1637 1634 // Go through the various installation directories and calculate their sizes. 1635 // No trailing slashes. 1638 /* 1639 * Go through the various installation directories and calculate their sizes. 1640 * No trailing slashes. 1641 */ 1636 1642 $paths = array( 1637 1643 'wordpress_size' => untrailingslashit( ABSPATH ), -
trunk/src/wp-admin/includes/class-wp-filesystem-base.php
r55824 r56174 58 58 $folder = $this->find_folder( ABSPATH ); 59 59 60 // Perhaps the FTP folder is rooted at the WordPress install. 61 // Check for wp-includes folder in root. Could have some false positives, but rare. 60 /* 61 * Perhaps the FTP folder is rooted at the WordPress install. 62 * Check for wp-includes folder in root. Could have some false positives, but rare. 63 */ 62 64 if ( ! $folder && $this->is_dir( '/' . WPINC ) ) { 63 65 $folder = '/'; … … 306 308 } 307 309 308 // Only check this as a last resort, to prevent locating the incorrect install. 309 // All above procedures will fail quickly if this is the right branch to take. 310 /* 311 * Only check this as a last resort, to prevent locating the incorrect install. 312 * All above procedures will fail quickly if this is the right branch to take. 313 */ 310 314 if ( isset( $files[ $last_path ] ) ) { 311 315 if ( $this->verbose ) { … … 317 321 } 318 322 319 // Prevent this function from looping again. 320 // No need to proceed if we've just searched in `/`. 323 /* 324 * Prevent this function from looping again. 325 * No need to proceed if we've just searched in `/`. 326 */ 321 327 if ( $loop || '/' === $base ) { 322 328 return false; 323 329 } 324 330 325 // As an extra last resort, Change back to / if the folder wasn't found. 326 // This comes into effect when the CWD is /home/user/ but WP is at /var/www/.... 331 /* 332 * As an extra last resort, Change back to / if the folder wasn't found. 333 * This comes into effect when the CWD is /home/user/ but WP is at /var/www/.... 334 */ 327 335 return $this->search_for_folder( $folder, '/', true ); 328 336 -
trunk/src/wp-admin/includes/class-wp-list-table.php
r56004 r56174 1143 1143 } 1144 1144 1145 // We need a primary defined so responsive views show something, 1146 // so let's fall back to the first non-checkbox column. 1145 /* 1146 * We need a primary defined so responsive views show something, 1147 * so let's fall back to the first non-checkbox column. 1148 */ 1147 1149 foreach ( $columns as $col => $column_name ) { 1148 1150 if ( 'cb' === $col ) { … … 1181 1183 $default = $this->get_default_primary_column_name(); 1182 1184 1183 // If the primary column doesn't exist, 1184 // fall back to the first non-checkbox column. 1185 /* 1186 * If the primary column doesn't exist, 1187 * fall back to the first non-checkbox column. 1188 */ 1185 1189 if ( ! isset( $columns[ $default ] ) ) { 1186 1190 $default = self::get_default_primary_column_name(); … … 1667 1671 } 1668 1672 1669 // Comments column uses HTML in the display name with screen reader text. 1670 // Strip tags to get closer to a user-friendly string. 1673 /* 1674 * Comments column uses HTML in the display name with screen reader text. 1675 * Strip tags to get closer to a user-friendly string. 1676 */ 1671 1677 $data = 'data-colname="' . esc_attr( wp_strip_all_tags( $column_display_name ) ) . '"'; 1672 1678 -
trunk/src/wp-admin/includes/class-wp-plugin-install-list-table.php
r55988 r56174 116 116 117 117 if ( current_user_can( 'upload_plugins' ) ) { 118 // No longer a real tab. Here for filter compatibility. 119 // Gets skipped in get_views(). 118 /* 119 * No longer a real tab. Here for filter compatibility. 120 * Gets skipped in get_views(). 121 */ 120 122 $tabs['upload'] = __( 'Upload Plugin' ); 121 123 } -
trunk/src/wp-admin/includes/class-wp-plugins-list-table.php
r56068 r56174 262 262 } elseif ( ( ! $screen->in_admin( 'network' ) && is_plugin_active( $plugin_file ) ) 263 263 || ( $screen->in_admin( 'network' ) && is_plugin_active_for_network( $plugin_file ) ) ) { 264 // On the non-network screen, populate the active list with plugins that are individually activated. 265 // On the network admin screen, populate the active list with plugins that are network-activated. 264 /* 265 * On the non-network screen, populate the active list with plugins that are individually activated. 266 * On the network admin screen, populate the active list with plugins that are network-activated. 267 */ 266 268 $plugins['active'][ $plugin_file ] = $plugin_data; 267 269 -
trunk/src/wp-admin/includes/class-wp-privacy-policy-content.php
r55703 r56174 104 104 sort( $new ); 105 105 106 // The == operator (equal, not identical) was used intentionally. 107 // See https://www.php.net/manual/en/language.operators.array.php 106 /* 107 * The == operator (equal, not identical) was used intentionally. 108 * See https://www.php.net/manual/en/language.operators.array.php 109 */ 108 110 if ( $new != $old ) { 109 // A plugin was activated or deactivated, or some policy text has changed. 110 // Show a notice on the relevant screens to inform the admin. 111 /* 112 * A plugin was activated or deactivated, or some policy text has changed. 113 * Show a notice on the relevant screens to inform the admin. 114 */ 111 115 add_action( 'admin_notices', array( 'WP_Privacy_Policy_Content', 'policy_text_changed_notice' ) ); 112 116 $state = 'changed'; -
trunk/src/wp-admin/includes/class-wp-site-health.php
r56117 r56174 773 773 } 774 774 775 // The PHP version is still receiving security fixes, but is lower than 776 // the expected minimum version that will be required by WordPress in the near future. 775 /* 776 * The PHP version is still receiving security fixes, but is lower than 777 * the expected minimum version that will be required by WordPress in the near future. 778 */ 777 779 if ( $response['is_secure'] && $response['is_lower_than_future_minimum'] ) { 778 780 // The `is_secure` array key name doesn't actually imply this is a secure version of PHP. It only means it receives security updates. … … 1558 1560 */ 1559 1561 public function get_test_https_status() { 1560 // Enforce fresh HTTPS detection results. This is normally invoked by using cron, 1561 // but for Site Health it should always rely on the latest results. 1562 /* 1563 * Enforce fresh HTTPS detection results. This is normally invoked by using cron, 1564 * but for Site Health it should always rely on the latest results. 1565 */ 1562 1566 wp_update_https_detection_errors(); 1563 1567 … … 1586 1590 1587 1591 if ( ! wp_is_using_https() ) { 1588 // If the website is not using HTTPS, provide more information 1589 // about whether it is supported and how it can be enabled. 1592 /* 1593 * If the website is not using HTTPS, provide more information 1594 * about whether it is supported and how it can be enabled. 1595 */ 1590 1596 $result['status'] = 'recommended'; 1591 1597 $result['label'] = __( 'Your website does not use HTTPS' ); … … 1841 1847 } 1842 1848 1843 // Run the auto-update tests in a separate class, 1844 // as there are many considerations to be made. 1849 /* 1850 * Run the auto-update tests in a separate class, 1851 * as there are many considerations to be made. 1852 */ 1845 1853 $automatic_updates = new WP_Site_Health_Auto_Updates(); 1846 1854 $tests = $automatic_updates->run_tests(); … … 3379 3387 $headers = array(); 3380 3388 3381 // Include basic auth in loopback requests. Note that this will only pass along basic auth when user is 3382 // initiating the test. If a site requires basic auth, the test will fail when it runs in WP Cron as part of 3383 // wp_site_health_scheduled_check. This logic is copied from WP_Site_Health::can_perform_loopback(). 3389 /* 3390 * Include basic auth in loopback requests. Note that this will only pass along basic auth when user is 3391 * initiating the test. If a site requires basic auth, the test will fail when it runs in WP Cron as part of 3392 * wp_site_health_scheduled_check. This logic is copied from WP_Site_Health::can_perform_loopback(). 3393 */ 3384 3394 if ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) { 3385 3395 $headers['Authorization'] = 'Basic ' . base64_encode( wp_unslash( $_SERVER['PHP_AUTH_USER'] ) . ':' . wp_unslash( $_SERVER['PHP_AUTH_PW'] ) ); -
trunk/src/wp-admin/includes/class-wp-upgrader.php
r56117 r56174 564 564 return new WP_Error( 'incompatible_archive_empty', $this->strings['incompatible_archive'], $this->strings['no_files'] ); 565 565 } else { 566 // It's only a single file, the upgrader will use the folder name of this file as the destination folder. 567 // Folder name is based on zip filename. 566 /* 567 * It's only a single file, the upgrader will use the folder name of this file as the destination folder. 568 * Folder name is based on zip filename. 569 */ 568 570 $source = trailingslashit( $args['source'] ); 569 571 } … … 642 644 } 643 645 } elseif ( $args['abort_if_destination_exists'] && $wp_filesystem->exists( $remote_destination ) ) { 644 // If we're not clearing the destination folder and something exists there already, bail. 645 // But first check to see if there are actually any files in the folder. 646 /* 647 * If we're not clearing the destination folder and something exists there already, bail. 648 * But first check to see if there are actually any files in the folder. 649 */ 646 650 $_files = $wp_filesystem->dirlist( $remote_destination ); 647 651 if ( ! empty( $_files ) ) { … … 822 826 $download = $this->download_package( $options['package'], true, $options['hook_extra'] ); 823 827 824 // Allow for signature soft-fail. 825 // WARNING: This may be removed in the future. 828 /* 829 * Allow for signature soft-fail. 830 * WARNING: This may be removed in the future. 831 */ 826 832 if ( is_wp_error( $download ) && $download->get_error_data( 'softfail-filename' ) ) { 827 833 -
trunk/src/wp-admin/includes/file.php
r56069 r56174 575 575 576 576 if ( function_exists( 'session_status' ) && PHP_SESSION_ACTIVE === session_status() ) { 577 // Close any active session to prevent HTTP requests from timing out 578 // when attempting to connect back to the site. 577 /* 578 * Close any active session to prevent HTTP requests from timing out 579 * when attempting to connect back to the site. 580 */ 579 581 session_write_close(); 580 582 } … … 1252 1254 1253 1255 if ( ! $signature ) { 1254 // Retrieve signatures from a file if the header wasn't included. 1255 // WordPress.org stores signatures at $package_url.sig. 1256 /* 1257 * Retrieve signatures from a file if the header wasn't included. 1258 * WordPress.org stores signatures at $package_url.sig. 1259 */ 1256 1260 1257 1261 $signature_url = false; … … 1387 1391 extension_loaded( 'opcache' ) 1388 1392 ) { 1389 // Sodium_Compat isn't compatible with PHP 7.2.0~7.2.2 due to a bug in the PHP Opcache extension, bail early as it'll fail. 1390 // https://bugs.php.net/bug.php?id=75938 1393 /* 1394 * Sodium_Compat isn't compatible with PHP 7.2.0~7.2.2 due to a bug in the PHP Opcache extension, bail early as it'll fail. 1395 * https://bugs.php.net/bug.php?id=75938 1396 */ 1391 1397 return new WP_Error( 1392 1398 'signature_verification_unsupported', … … 1421 1427 } 1422 1428 1423 // This cannot be performed in a reasonable amount of time. 1424 // https://github.com/paragonie/sodium_compat#help-sodium_compat-is-slow-how-can-i-make-it-fast 1429 /* 1430 * This cannot be performed in a reasonable amount of time. 1431 * https://github.com/paragonie/sodium_compat#help-sodium_compat-is-slow-how-can-i-make-it-fast 1432 */ 1425 1433 if ( ! $sodium_compat_is_fast ) { 1426 1434 return new WP_Error( … … 2328 2336 ); 2329 2337 2330 // If defined, set it to that. Else, if POST'd, set it to that. If not, set it to an empty string. 2331 // Otherwise, keep it as it previously was (saved details in option). 2338 /* 2339 * If defined, set it to that. Else, if POST'd, set it to that. If not, set it to an empty string. 2340 * Otherwise, keep it as it previously was (saved details in option). 2341 */ 2332 2342 foreach ( $ftp_constants as $key => $constant ) { 2333 2343 if ( defined( $constant ) ) { … … 2532 2542 } 2533 2543 2534 // Make sure the `submit_button()` function is available during the REST API call 2535 // from WP_Site_Health_Auto_Updates::test_check_wp_filesystem_method(). 2544 /* 2545 * Make sure the `submit_button()` function is available during the REST API call 2546 * from WP_Site_Health_Auto_Updates::test_check_wp_filesystem_method(). 2547 */ 2536 2548 if ( ! function_exists( 'submit_button' ) ) { 2537 2549 require_once ABSPATH . 'wp-admin/includes/template.php'; -
trunk/src/wp-admin/includes/image.php
r54226 r56174 29 29 30 30 if ( ! file_exists( $src_file ) ) { 31 // If the file doesn't exist, attempt a URL fopen on the src link. 32 // This can occur with certain file replication plugins. 31 /* 32 * If the file doesn't exist, attempt a URL fopen on the src link. 33 * This can occur with certain file replication plugins. 34 */ 33 35 $src = _load_image_to_edit_path( $src, 'full' ); 34 36 } else { … … 160 162 161 163 if ( empty( $image_meta ) || ! is_array( $image_meta ) ) { 162 // Previously failed upload? 163 // If there is an uploaded file, make all sub-sizes and generate all of the attachment meta. 164 /* 165 * Previously failed upload? 166 * If there is an uploaded file, make all sub-sizes and generate all of the attachment meta. 167 */ 164 168 if ( ! empty( $image_file ) ) { 165 169 $image_meta = wp_create_image_subsizes( $image_file, $attachment_id ); … … 284 288 $threshold = (int) apply_filters( 'big_image_size_threshold', 2560, $imagesize, $file, $attachment_id ); 285 289 286 // If the original image's dimensions are over the threshold, 287 // scale the image and use it as the "full" size. 290 /* 291 * If the original image's dimensions are over the threshold, 292 * scale the image and use it as the "full" size. 293 */ 288 294 if ( $threshold && ( $image_meta['width'] > $threshold || $image_meta['height'] > $threshold ) ) { 289 295 $editor = wp_get_image_editor( $file ); … … 305 311 306 312 if ( ! is_wp_error( $resized ) ) { 307 // Append "-scaled" to the image file name. It will look like "my_image-scaled.jpg". 308 // This doesn't affect the sub-sizes names as they are generated from the original image (for best quality). 313 /* 314 * Append "-scaled" to the image file name. It will look like "my_image-scaled.jpg". 315 * This doesn't affect the sub-sizes names as they are generated from the original image (for best quality). 316 */ 309 317 $saved = $editor->save( $editor->generate_filename( 'scaled' ) ); 310 318 -
trunk/src/wp-admin/includes/media.php
r56031 r56174 423 423 424 424 if ( ! is_wp_error( $attachment_id ) ) { 425 // Set a custom header with the attachment_id. 426 // Used by the browser/client to resume creating image sub-sizes after a PHP fatal error. 425 /* 426 * Set a custom header with the attachment_id. 427 * Used by the browser/client to resume creating image sub-sizes after a PHP fatal error. 428 */ 427 429 if ( ! headers_sent() ) { 428 430 header( 'X-WP-Upload-Attachment-ID: ' . $attachment_id ); 429 431 } 430 432 431 // The image sub-sizes are created during wp_generate_attachment_metadata(). 432 // This is generally slow and may cause timeouts or out of memory errors. 433 /* 434 * The image sub-sizes are created during wp_generate_attachment_metadata(). 435 * This is generally slow and may cause timeouts or out of memory errors. 436 */ 433 437 wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $file ) ); 434 438 } -
trunk/src/wp-admin/includes/meta-boxes.php
r55949 r56174 1673 1673 do_action_deprecated( 'dbx_post_advanced', array( $post ), '3.7.0', 'add_meta_boxes' ); 1674 1674 1675 // Allow the Discussion meta box to show up if the post type supports comments, 1676 // or if comments or pings are open. 1675 /* 1676 * Allow the Discussion meta box to show up if the post type supports comments, 1677 * or if comments or pings are open. 1678 */ 1677 1679 if ( comments_open( $post ) || pings_open( $post ) || post_type_supports( $post_type, 'comments' ) ) { 1678 1680 add_meta_box( 'commentstatusdiv', __( 'Discussion' ), 'post_comment_status_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); … … 1686 1688 1687 1689 if ( in_array( get_post_status( $post ), $stati, true ) ) { 1688 // If the post type support comments, or the post has comments, 1689 // allow the Comments meta box. 1690 /* 1691 * If the post type support comments, or the post has comments, 1692 * allow the Comments meta box. 1693 */ 1690 1694 if ( comments_open( $post ) || pings_open( $post ) || $post->comment_count > 0 || post_type_supports( $post_type, 'comments' ) ) { 1691 1695 add_meta_box( 'commentsdiv', __( 'Comments' ), 'post_comment_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );
Note: See TracChangeset
for help on using the changeset viewer.