Make WordPress Core

Changeset 56174


Ignore:
Timestamp:
07/09/2023 07:50:52 PM (3 years ago)
Author:
audrasjb
Message:

Docs: Replace multiple single line comments with multi-line comments.

This changeset updates various comments as per WordPress PHP Inline Documentation Standards.
See https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/#5-inline-comments.

Props costdev, audrasjb.
See #58459.

Location:
trunk/src/wp-admin/includes
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ajax-actions.php

    r56031 r56174  
    299299        $return = array();
    300300
    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         */
    303305        if ( isset( $_REQUEST['autocomplete_type'] ) && 'search' === $_REQUEST['autocomplete_type'] ) {
    304306                $type = $_REQUEST['autocomplete_type'];
     
    307309        }
    308310
    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         */
    311315        if ( isset( $_REQUEST['autocomplete_field'] ) && 'user_email' === $_REQUEST['autocomplete_field'] ) {
    312316                $field = $_REQUEST['autocomplete_field'];
     
    15211525        require_once ABSPATH . 'wp-admin/includes/nav-menu.php';
    15221526
    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         */
    15251531        $menu_items_data = array();
    15261532
     
    25132519        }
    25142520
    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         */
    25172525        if ( ! headers_sent() ) {
    25182526                header( 'X-WP-Upload-Attachment-ID: ' . $attachment_id );
    25192527        }
    25202528
    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         */
    25232533        wp_update_image_subsizes( $attachment_id );
    25242534
     
    37703780
    37713781        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                 */
    37743786                $ssl_shortcode = preg_replace( '%^(\\[embed[^\\]]*\\])http://%i', '$1https://', $shortcode );
    37753787                $parsed        = $wp_embed->run_shortcode( $ssl_shortcode );
  • trunk/src/wp-admin/includes/class-core-upgrader.php

    r55990 r56174  
    124124                $download = $this->download_package( $current->packages->$to_download, true );
    125125
    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                 */
    128130                if ( is_wp_error( $download ) && $download->get_error_data( 'softfail-filename' ) ) {
    129131                        // Output the failure error as a normal feedback, and not as an error:
  • trunk/src/wp-admin/includes/class-plugin-upgrader.php

    r55911 r56174  
    213213                add_filter( 'upgrader_clear_destination', array( $this, 'delete_old_plugin' ), 10, 4 );
    214214                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                 */
    217219                if ( $parsed_args['clear_update_cache'] ) {
    218220                        // Clear cache so wp_update_plugins() knows about the new plugin.
     
    253255                wp_clean_plugins_cache( $parsed_args['clear_update_cache'] );
    254256
    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                 */
    257261                $past_failure_emails = get_option( 'auto_plugin_theme_update_emails', array() );
    258262
     
    390394                remove_filter( 'upgrader_clear_destination', array( $this, 'delete_old_plugin' ) );
    391395
    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                 */
    394400                $past_failure_emails = get_option( 'auto_plugin_theme_update_emails', array() );
    395401
     
    652658                }
    653659
    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                 */
    656664                if ( strpos( $plugin, '/' ) && $this_plugin_dir !== $plugins_dir ) {
    657665                        $deleted = $wp_filesystem->delete( $this_plugin_dir, true );
  • trunk/src/wp-admin/includes/class-theme-upgrader.php

    r55911 r56174  
    352352                wp_clean_themes_cache( $parsed_args['clear_update_cache'] );
    353353
    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                 */
    356358                $past_failure_emails = get_option( 'auto_plugin_theme_update_emails', array() );
    357359
     
    493495                remove_filter( 'upgrader_clear_destination', array( $this, 'delete_old_theme' ) );
    494496
    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                 */
    497501                $past_failure_emails = get_option( 'auto_plugin_theme_update_emails', array() );
    498502
  • trunk/src/wp-admin/includes/class-wp-automatic-updater.php

    r56124 r56174  
    471471                                        || 'locked' === $upgrade_result->get_error_code() )
    472472                        ) {
    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                                 */
    475477                                return false;
    476478                        }
     
    549551                }
    550552
    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                 */
    553557                $theme_stats = array();
    554558                if ( isset( $this->update_results['theme'] ) ) {
     
    639643                $error_code = $result->get_error_code();
    640644
    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                 */
    643649                $critical = false;
    644650                if ( 'disk_full' === $error_code || str_contains( $error_code, '__copy_dir' ) ) {
     
    832838                                $body .= "\n\n";
    833839
    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                                 */
    836844                                if ( 'fail' === $type && ! $newer_version_available ) {
    837845                                        $body .= __( 'An attempt was made, but your site could not be updated automatically.' ) . ' ';
     
    904912                        $body .= ' ' . __( 'Your hosting company, support forum volunteers, or a friendly developer may be able to use this information to help you:' );
    905913
    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                         */
    908918                        if ( 'rollback_was_required' === $result->get_error_code() ) {
    909919                                $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  
    16201620                }
    16211621
    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                 */
    16241626                if ( empty( $max_execution_time ) ) {
    16251627                        $max_execution_time = 30; // 30 seconds.
     
    16271629
    16281630                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                         */
    16311635                        $max_execution_time -= 2;
    16321636                }
    16331637
    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                 */
    16361642                $paths = array(
    16371643                        'wordpress_size' => untrailingslashit( ABSPATH ),
  • trunk/src/wp-admin/includes/class-wp-filesystem-base.php

    r55824 r56174  
    5858                $folder = $this->find_folder( ABSPATH );
    5959
    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                 */
    6264                if ( ! $folder && $this->is_dir( '/' . WPINC ) ) {
    6365                        $folder = '/';
     
    306308                }
    307309
    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                 */
    310314                if ( isset( $files[ $last_path ] ) ) {
    311315                        if ( $this->verbose ) {
     
    317321                }
    318322
    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                 */
    321327                if ( $loop || '/' === $base ) {
    322328                        return false;
    323329                }
    324330
    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                 */
    327335                return $this->search_for_folder( $folder, '/', true );
    328336
  • trunk/src/wp-admin/includes/class-wp-list-table.php

    r56004 r56174  
    11431143                }
    11441144
    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                 */
    11471149                foreach ( $columns as $col => $column_name ) {
    11481150                        if ( 'cb' === $col ) {
     
    11811183                $default = $this->get_default_primary_column_name();
    11821184
    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                 */
    11851189                if ( ! isset( $columns[ $default ] ) ) {
    11861190                        $default = self::get_default_primary_column_name();
     
    16671671                        }
    16681672
    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                         */
    16711677                        $data = 'data-colname="' . esc_attr( wp_strip_all_tags( $column_display_name ) ) . '"';
    16721678
  • trunk/src/wp-admin/includes/class-wp-plugin-install-list-table.php

    r55988 r56174  
    116116
    117117                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                         */
    120122                        $tabs['upload'] = __( 'Upload Plugin' );
    121123                }
  • trunk/src/wp-admin/includes/class-wp-plugins-list-table.php

    r56068 r56174  
    262262                        } elseif ( ( ! $screen->in_admin( 'network' ) && is_plugin_active( $plugin_file ) )
    263263                                || ( $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                                 */
    266268                                $plugins['active'][ $plugin_file ] = $plugin_data;
    267269
  • trunk/src/wp-admin/includes/class-wp-privacy-policy-content.php

    r55703 r56174  
    104104                sort( $new );
    105105
    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                 */
    108110                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                         */
    111115                        add_action( 'admin_notices', array( 'WP_Privacy_Policy_Content', 'policy_text_changed_notice' ) );
    112116                        $state = 'changed';
  • trunk/src/wp-admin/includes/class-wp-site-health.php

    r56117 r56174  
    773773                }
    774774
    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                 */
    777779                if ( $response['is_secure'] && $response['is_lower_than_future_minimum'] ) {
    778780                        // The `is_secure` array key name doesn't actually imply this is a secure version of PHP. It only means it receives security updates.
     
    15581560         */
    15591561        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                 */
    15621566                wp_update_https_detection_errors();
    15631567
     
    15861590
    15871591                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                         */
    15901596                        $result['status'] = 'recommended';
    15911597                        $result['label']  = __( 'Your website does not use HTTPS' );
     
    18411847                }
    18421848
    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                 */
    18451853                $automatic_updates = new WP_Site_Health_Auto_Updates();
    18461854                $tests             = $automatic_updates->run_tests();
     
    33793387                $headers = array();
    33803388
    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                 */
    33843394                if ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) {
    33853395                        $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  
    564564                        return new WP_Error( 'incompatible_archive_empty', $this->strings['incompatible_archive'], $this->strings['no_files'] );
    565565                } 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                         */
    568570                        $source = trailingslashit( $args['source'] );
    569571                }
     
    642644                        }
    643645                } 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                         */
    646650                        $_files = $wp_filesystem->dirlist( $remote_destination );
    647651                        if ( ! empty( $_files ) ) {
     
    822826                $download = $this->download_package( $options['package'], true, $options['hook_extra'] );
    823827
    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                 */
    826832                if ( is_wp_error( $download ) && $download->get_error_data( 'softfail-filename' ) ) {
    827833
  • trunk/src/wp-admin/includes/file.php

    r56069 r56174  
    575575
    576576                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                         */
    579581                        session_write_close();
    580582                }
     
    12521254
    12531255                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                         */
    12561260
    12571261                        $signature_url = false;
     
    13871391                extension_loaded( 'opcache' )
    13881392        ) {
    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                 */
    13911397                return new WP_Error(
    13921398                        'signature_verification_unsupported',
     
    14211427                }
    14221428
    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                 */
    14251433                if ( ! $sodium_compat_is_fast ) {
    14261434                        return new WP_Error(
     
    23282336        );
    23292337
    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         */
    23322342        foreach ( $ftp_constants as $key => $constant ) {
    23332343                if ( defined( $constant ) ) {
     
    25322542        }
    25332543
    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         */
    25362548        if ( ! function_exists( 'submit_button' ) ) {
    25372549                require_once ABSPATH . 'wp-admin/includes/template.php';
  • trunk/src/wp-admin/includes/image.php

    r54226 r56174  
    2929
    3030                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                         */
    3335                        $src = _load_image_to_edit_path( $src, 'full' );
    3436                } else {
     
    160162
    161163        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                 */
    164168                if ( ! empty( $image_file ) ) {
    165169                        $image_meta = wp_create_image_subsizes( $image_file, $attachment_id );
     
    284288                $threshold = (int) apply_filters( 'big_image_size_threshold', 2560, $imagesize, $file, $attachment_id );
    285289
    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                 */
    288294                if ( $threshold && ( $image_meta['width'] > $threshold || $image_meta['height'] > $threshold ) ) {
    289295                        $editor = wp_get_image_editor( $file );
     
    305311
    306312                        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                                 */
    309317                                $saved = $editor->save( $editor->generate_filename( 'scaled' ) );
    310318
  • trunk/src/wp-admin/includes/media.php

    r56031 r56174  
    423423
    424424        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                 */
    427429                if ( ! headers_sent() ) {
    428430                        header( 'X-WP-Upload-Attachment-ID: ' . $attachment_id );
    429431                }
    430432
    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                 */
    433437                wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $file ) );
    434438        }
  • trunk/src/wp-admin/includes/meta-boxes.php

    r55949 r56174  
    16731673        do_action_deprecated( 'dbx_post_advanced', array( $post ), '3.7.0', 'add_meta_boxes' );
    16741674
    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         */
    16771679        if ( comments_open( $post ) || pings_open( $post ) || post_type_supports( $post_type, 'comments' ) ) {
    16781680                add_meta_box( 'commentstatusdiv', __( 'Discussion' ), 'post_comment_status_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );
     
    16861688
    16871689        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                 */
    16901694                if ( comments_open( $post ) || pings_open( $post ) || $post->comment_count > 0 || post_type_supports( $post_type, 'comments' ) ) {
    16911695                        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.