diff options
Diffstat (limited to 'src/wp-admin/includes')
29 files changed, 156 insertions, 86 deletions
diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php index 83b682634b..53635479e0 100644 --- a/src/wp-admin/includes/ajax-actions.php +++ b/src/wp-admin/includes/ajax-actions.php @@ -5354,7 +5354,7 @@ function wp_ajax_health_check_dotorg_communication() { _doing_it_wrong( 'wp_ajax_health_check_dotorg_communication', sprintf( - // translators: 1: The Site Health action that is no longer used by core. 2: The new function that replaces it. + /* translators: 1: The Site Health action that is no longer used by core. 2: The new function that replaces it. */ __( 'The Site Health check for %1$s has been replaced with %2$s.' ), 'wp_ajax_health_check_dotorg_communication', 'WP_REST_Site_Health_Controller::test_dotorg_communication' @@ -5387,7 +5387,7 @@ function wp_ajax_health_check_background_updates() { _doing_it_wrong( 'wp_ajax_health_check_background_updates', sprintf( - // translators: 1: The Site Health action that is no longer used by core. 2: The new function that replaces it. + /* translators: 1: The Site Health action that is no longer used by core. 2: The new function that replaces it. */ __( 'The Site Health check for %1$s has been replaced with %2$s.' ), 'wp_ajax_health_check_background_updates', 'WP_REST_Site_Health_Controller::test_background_updates' @@ -5420,7 +5420,7 @@ function wp_ajax_health_check_loopback_requests() { _doing_it_wrong( 'wp_ajax_health_check_loopback_requests', sprintf( - // translators: 1: The Site Health action that is no longer used by core. 2: The new function that replaces it. + /* translators: 1: The Site Health action that is no longer used by core. 2: The new function that replaces it. */ __( 'The Site Health check for %1$s has been replaced with %2$s.' ), 'wp_ajax_health_check_loopback_requests', 'WP_REST_Site_Health_Controller::test_loopback_requests' @@ -5470,7 +5470,7 @@ function wp_ajax_health_check_get_sizes() { _doing_it_wrong( 'wp_ajax_health_check_get_sizes', sprintf( - // translators: 1: The Site Health action that is no longer used by core. 2: The new function that replaces it. + /* translators: 1: The Site Health action that is no longer used by core. 2: The new function that replaces it. */ __( 'The Site Health check for %1$s has been replaced with %2$s.' ), 'wp_ajax_health_check_get_sizes', 'WP_REST_Site_Health_Controller::get_directory_sizes' diff --git a/src/wp-admin/includes/class-custom-image-header.php b/src/wp-admin/includes/class-custom-image-header.php index 54be1d90e4..3716b55909 100644 --- a/src/wp-admin/includes/class-custom-image-header.php +++ b/src/wp-admin/includes/class-custom-image-header.php @@ -951,7 +951,7 @@ endif; <p class="submit"> <?php submit_button( __( 'Crop and Publish' ), 'primary', 'submit', false ); ?> <?php - if ( isset( $oitar ) && 1 === $oitar + if ( 1 === $oitar && ( current_theme_supports( 'custom-header', 'flex-height' ) || current_theme_supports( 'custom-header', 'flex-width' ) ) ) { diff --git a/src/wp-admin/includes/class-language-pack-upgrader.php b/src/wp-admin/includes/class-language-pack-upgrader.php index 6f7cf742bd..89b9f9ac87 100644 --- a/src/wp-admin/includes/class-language-pack-upgrader.php +++ b/src/wp-admin/includes/class-language-pack-upgrader.php @@ -383,7 +383,7 @@ class Language_Pack_Upgrader extends WP_Upgrader { case 'theme': $theme = wp_get_theme( $update->slug ); if ( $theme->exists() ) { - return $theme->Get( 'Name' ); + return $theme->get( 'Name' ); } break; case 'plugin': diff --git a/src/wp-admin/includes/class-walker-nav-menu-checklist.php b/src/wp-admin/includes/class-walker-nav-menu-checklist.php index 6fc5c41690..099d250076 100644 --- a/src/wp-admin/includes/class-walker-nav-menu-checklist.php +++ b/src/wp-admin/includes/class-walker-nav-menu-checklist.php @@ -117,7 +117,7 @@ class Walker_Nav_Menu_Checklist extends Walker_Nav_Menu { $output .= '<input type="hidden" class="menu-item-parent-id" name="menu-item[' . $possible_object_id . '][menu-item-parent-id]" value="' . esc_attr( $menu_item->menu_item_parent ) . '" />'; $output .= '<input type="hidden" class="menu-item-type" name="menu-item[' . $possible_object_id . '][menu-item-type]" value="' . esc_attr( $menu_item->type ) . '" />'; $output .= '<input type="hidden" class="menu-item-title" name="menu-item[' . $possible_object_id . '][menu-item-title]" value="' . esc_attr( $menu_item->title ) . '" />'; - $output .= '<input type="hidden" class="menu-item-url" name="menu-item[' . $possible_object_id . '][menu-item-url]" value="' . esc_attr( $menu_item->url ) . '" />'; + $output .= '<input type="hidden" class="menu-item-url" name="menu-item[' . $possible_object_id . '][menu-item-url]" value="' . esc_url( $menu_item->url ) . '" />'; $output .= '<input type="hidden" class="menu-item-target" name="menu-item[' . $possible_object_id . '][menu-item-target]" value="' . esc_attr( $menu_item->target ) . '" />'; $output .= '<input type="hidden" class="menu-item-attr-title" name="menu-item[' . $possible_object_id . '][menu-item-attr-title]" value="' . esc_attr( $menu_item->attr_title ) . '" />'; $output .= '<input type="hidden" class="menu-item-classes" name="menu-item[' . $possible_object_id . '][menu-item-classes]" value="' . esc_attr( implode( ' ', $menu_item->classes ) ) . '" />'; diff --git a/src/wp-admin/includes/class-walker-nav-menu-edit.php b/src/wp-admin/includes/class-walker-nav-menu-edit.php index 026da47acc..66ea47bb1f 100644 --- a/src/wp-admin/includes/class-walker-nav-menu-edit.php +++ b/src/wp-admin/includes/class-walker-nav-menu-edit.php @@ -196,7 +196,7 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu { <p class="field-url description description-wide"> <label for="edit-menu-item-url-<?php echo $item_id; ?>"> <?php _e( 'URL' ); ?><br /> - <input type="text" id="edit-menu-item-url-<?php echo $item_id; ?>" class="widefat code edit-menu-item-url" name="menu-item-url[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $menu_item->url ); ?>" /> + <input type="text" id="edit-menu-item-url-<?php echo $item_id; ?>" class="widefat code edit-menu-item-url" name="menu-item-url[<?php echo $item_id; ?>]" value="<?php echo esc_url( $menu_item->url ); ?>" /> </label> </p> <?php endif; ?> diff --git a/src/wp-admin/includes/class-wp-automatic-updater.php b/src/wp-admin/includes/class-wp-automatic-updater.php index 4dccd94ccd..2facbeb1d5 100644 --- a/src/wp-admin/includes/class-wp-automatic-updater.php +++ b/src/wp-admin/includes/class-wp-automatic-updater.php @@ -411,7 +411,7 @@ class WP_Automatic_Updater { case 'theme': $upgrader_item = $item->theme; $theme = wp_get_theme( $upgrader_item ); - $item_name = $theme->Get( 'Name' ); + $item_name = $theme->get( 'Name' ); // Add the current version so that it can be reported in the notification email. $item->current_version = $theme->get( 'Version' ); if ( empty( $item->current_version ) ) { diff --git a/src/wp-admin/includes/class-wp-community-events.php b/src/wp-admin/includes/class-wp-community-events.php index 008611af21..b5a65e298d 100644 --- a/src/wp-admin/includes/class-wp-community-events.php +++ b/src/wp-admin/includes/class-wp-community-events.php @@ -375,17 +375,13 @@ class WP_Community_Events { * of the user who triggered the cache refresh, rather than their own. * * @since 4.8.0 - * @deprecated 5.6.0 No longer used in core. + * @deprecated 5.5.2 No longer used in core. * * @param array $response_body The response which contains the events. * @return array The response with dates and times formatted. */ protected function format_event_data_time( $response_body ) { - _deprecated_function( - __METHOD__, - '5.5.2', - 'This is no longer used by core, and only kept for backward compatibility.' - ); + _deprecated_function( __METHOD__, '5.5.2' ); if ( isset( $response_body['events'] ) ) { foreach ( $response_body['events'] as $key => $event ) { diff --git a/src/wp-admin/includes/class-wp-debug-data.php b/src/wp-admin/includes/class-wp-debug-data.php index cbb57a4b8c..cd04297684 100644 --- a/src/wp-admin/includes/class-wp-debug-data.php +++ b/src/wp-admin/includes/class-wp-debug-data.php @@ -682,6 +682,25 @@ class WP_Debug_Data { ); } + // Get the image format transforms. + $mappings = wp_get_image_editor_output_format( '', '' ); + $formatted_mappings = array(); + + if ( ! empty( $mappings ) ) { + foreach ( $mappings as $format => $mime_type ) { + $formatted_mappings[] = sprintf( '%s → %s', $format, $mime_type ); + } + $mappings_display = implode( ', ', $formatted_mappings ); + } else { + $mappings_display = __( 'No format transforms defined' ); + } + + $fields['image_format_transforms'] = array( + 'label' => __( 'Image format transforms' ), + 'value' => $mappings_display, + 'debug' => ( empty( $mappings ) ) ? 'No format transforms defined' : $mappings_display, + ); + // Get GD information, if available. if ( function_exists( 'gd_info' ) ) { $gd = gd_info(); @@ -1860,10 +1879,14 @@ class WP_Debug_Data { * Intended to supplement the array returned by `WP_Debug_Data::debug_data()`. * * @since 5.2.0 + * @deprecated 5.6.0 Use WP_REST_Site_Health_Controller::get_directory_sizes() + * @see WP_REST_Site_Health_Controller::get_directory_sizes() * * @return array The sizes of the directories, also the database size and total installation size. */ public static function get_sizes() { + _deprecated_function( __METHOD__, '5.6.0', 'WP_REST_Site_Health_Controller::get_directory_sizes()' ); + $size_db = self::get_database_size(); $upload_dir = wp_get_upload_dir(); diff --git a/src/wp-admin/includes/class-wp-filesystem-ftpext.php b/src/wp-admin/includes/class-wp-filesystem-ftpext.php index 0294720ccd..7c721734c3 100644 --- a/src/wp-admin/includes/class-wp-filesystem-ftpext.php +++ b/src/wp-admin/includes/class-wp-filesystem-ftpext.php @@ -601,9 +601,11 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { } /** - * @param string $line - * @return array { - * Array of file information. + * Parses an individual entry from the FTP LIST command output. + * + * @param string $line A line from the directory listing. + * @return array|string { + * Array of file information. Empty string if the line could not be parsed. * * @type string $name Name of the file or directory. * @type string $perms *nix representation of permissions. @@ -658,7 +660,6 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { $lucifer = preg_split( '/[ ]/', $line, 9, PREG_SPLIT_NO_EMPTY ); if ( $lucifer ) { - // echo $line."\n"; $lcount = count( $lucifer ); if ( $lcount < 8 ) { diff --git a/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php b/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php index 9a37d88c11..986fccf2cf 100644 --- a/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php +++ b/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php @@ -77,7 +77,7 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base { return false; } - $this->ftp->setTimeout( FS_CONNECT_TIMEOUT ); + $this->ftp->SetTimeout( FS_CONNECT_TIMEOUT ); if ( ! $this->ftp->SetServer( $this->options['hostname'], $this->options['port'] ) ) { $this->errors->add( @@ -120,7 +120,7 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base { $this->ftp->SetType( FTP_BINARY ); $this->ftp->Passive( true ); - $this->ftp->setTimeout( FS_TIMEOUT ); + $this->ftp->SetTimeout( FS_TIMEOUT ); return true; } diff --git a/src/wp-admin/includes/class-wp-list-table.php b/src/wp-admin/includes/class-wp-list-table.php index 4bad78b823..cdf31db597 100644 --- a/src/wp-admin/includes/class-wp-list-table.php +++ b/src/wp-admin/includes/class-wp-list-table.php @@ -72,10 +72,10 @@ class WP_List_Table { protected $modes = array(); /** - * Stores the value returned by ->get_column_info(). + * Stores the value returned by ::get_column_info(). * * @since 4.1.0 - * @var array + * @var array|null */ protected $_column_headers; @@ -1540,7 +1540,6 @@ class WP_List_Table { * should be provided via get_sortable_columns(). * * @since 6.3.0 - * @access public */ public function print_table_description() { list( $columns, $hidden, $sortable ) = $this->get_column_info(); diff --git a/src/wp-admin/includes/class-wp-ms-sites-list-table.php b/src/wp-admin/includes/class-wp-ms-sites-list-table.php index 01968869a1..6097f5e13e 100644 --- a/src/wp-admin/includes/class-wp-ms-sites-list-table.php +++ b/src/wp-admin/includes/class-wp-ms-sites-list-table.php @@ -37,7 +37,7 @@ class WP_MS_Sites_List_Table extends WP_List_Table { $this->status_list = array( 'archived' => array( 'site-archived', __( 'Archived' ) ), 'spam' => array( 'site-spammed', _x( 'Spam', 'site' ) ), - 'deleted' => array( 'site-deleted', __( 'Deleted' ) ), + 'deleted' => array( 'site-deleted', __( 'Flagged for Deletion' ) ), 'mature' => array( 'site-mature', __( 'Mature' ) ), ); @@ -256,8 +256,8 @@ class WP_MS_Sites_List_Table extends WP_List_Table { /* translators: %s: Number of sites. */ 'deleted' => _n_noop( - 'Deleted <span class="count">(%s)</span>', - 'Deleted <span class="count">(%s)</span>' + 'Flagged for Deletion <span class="count">(%s)</span>', + 'Flagged for Deletion <span class="count">(%s)</span>' ), ); @@ -667,7 +667,7 @@ class WP_MS_Sites_List_Table extends WP_List_Table { * @since 5.3.0 * * @param string[] $site_states An array of site states. Default 'Main', - * 'Archived', 'Mature', 'Spam', 'Deleted'. + * 'Archived', 'Mature', 'Spam', 'Flagged for Deletion'. * @param WP_Site $site The current site object. */ $site_states = apply_filters( 'display_site_states', $site_states, $_site ); @@ -758,7 +758,7 @@ class WP_MS_Sites_List_Table extends WP_List_Table { 'activateblog_' . $blog['blog_id'] ) ), - _x( 'Activate', 'site' ) + _x( 'Remove Deletion Flag', 'site' ) ); } else { $actions['deactivate'] = sprintf( @@ -769,7 +769,7 @@ class WP_MS_Sites_List_Table extends WP_List_Table { 'deactivateblog_' . $blog['blog_id'] ) ), - __( 'Deactivate' ) + __( 'Flag for Deletion' ) ); } @@ -830,7 +830,7 @@ class WP_MS_Sites_List_Table extends WP_List_Table { 'deleteblog_' . $blog['blog_id'] ) ), - __( 'Delete' ) + __( 'Delete Permanently' ) ); } } @@ -844,9 +844,9 @@ class WP_MS_Sites_List_Table extends WP_List_Table { /** * Filters the action links displayed for each site in the Sites list table. * - * The 'Edit', 'Dashboard', 'Delete', and 'Visit' links are displayed by + * The 'Edit', 'Dashboard', 'Delete Permanently', and 'Visit' links are displayed by * default for each site. The site's status determines whether to show the - * 'Activate' or 'Deactivate' link, 'Unarchive' or 'Archive' links, and + * 'Remove Deletion Flag' or 'Flag for Deletion' link, 'Unarchive' or 'Archive' links, and * 'Not Spam' or 'Spam' link for each site. * * @since 3.1.0 diff --git a/src/wp-admin/includes/class-wp-plugin-install-list-table.php b/src/wp-admin/includes/class-wp-plugin-install-list-table.php index f39ec60a24..df0260be81 100644 --- a/src/wp-admin/includes/class-wp-plugin-install-list-table.php +++ b/src/wp-admin/includes/class-wp-plugin-install-list-table.php @@ -36,7 +36,6 @@ class WP_Plugin_Install_List_Table extends WP_List_Table { * installed plugins. * * @since 4.9.0 - * @access protected * * @return array */ diff --git a/src/wp-admin/includes/class-wp-posts-list-table.php b/src/wp-admin/includes/class-wp-posts-list-table.php index 3d25b2f7ff..9be86455e2 100644 --- a/src/wp-admin/includes/class-wp-posts-list-table.php +++ b/src/wp-admin/includes/class-wp-posts-list-table.php @@ -496,7 +496,6 @@ class WP_Posts_List_Table extends WP_List_Table { * Displays a formats drop-down for filtering items. * * @since 5.2.0 - * @access protected * * @param string $post_type Post type slug. */ diff --git a/src/wp-admin/includes/class-wp-screen.php b/src/wp-admin/includes/class-wp-screen.php index 4bb5995e7f..27801f3695 100644 --- a/src/wp-admin/includes/class-wp-screen.php +++ b/src/wp-admin/includes/class-wp-screen.php @@ -986,6 +986,8 @@ final class WP_Screen { /** * @global array $wp_meta_boxes Global meta box state. * + * @since 3.3.0 + * * @return bool */ public function show_screen_options() { diff --git a/src/wp-admin/includes/class-wp-site-health.php b/src/wp-admin/includes/class-wp-site-health.php index afcbfcb6f9..b7847d5e31 100644 --- a/src/wp-admin/includes/class-wp-site-health.php +++ b/src/wp-admin/includes/class-wp-site-health.php @@ -18,7 +18,7 @@ class WP_Site_Health { private $mysql_server_version = ''; private $mysql_required_version = '5.5'; private $mysql_recommended_version = '8.0'; - private $mariadb_recommended_version = '10.5'; + private $mariadb_recommended_version = '10.6'; public $php_memory_limit; diff --git a/src/wp-admin/includes/class-wp-upgrader.php b/src/wp-admin/includes/class-wp-upgrader.php index 4064dfb644..d5a430d25a 100644 --- a/src/wp-admin/includes/class-wp-upgrader.php +++ b/src/wp-admin/includes/class-wp-upgrader.php @@ -403,7 +403,6 @@ class WP_Upgrader { * Flattens the results of WP_Filesystem_Base::dirlist() for iterating over. * * @since 4.9.0 - * @access protected * * @param array $nested_files Array of files as returned by WP_Filesystem_Base::dirlist(). * @param string $path Relative path to prepend to child nodes. Optional. @@ -1023,18 +1022,21 @@ class WP_Upgrader { } $file = $wp_filesystem->abspath() . '.maintenance'; + if ( $enable ) { if ( ! wp_doing_cron() ) { $this->skin->feedback( 'maintenance_start' ); } + // Create maintenance file to signal that we are upgrading. $maintenance_string = '<?php $upgrading = ' . time() . '; ?>'; $wp_filesystem->delete( $file ); $wp_filesystem->put_contents( $file, $maintenance_string, FS_CHMOD_FILE ); - } elseif ( ! $enable && $wp_filesystem->exists( $file ) ) { + } elseif ( $wp_filesystem->exists( $file ) ) { if ( ! wp_doing_cron() ) { $this->skin->feedback( 'maintenance_end' ); } + $wp_filesystem->delete( $file ); } } diff --git a/src/wp-admin/includes/comment.php b/src/wp-admin/includes/comment.php index ffec90c81e..ad8b653161 100644 --- a/src/wp-admin/includes/comment.php +++ b/src/wp-admin/includes/comment.php @@ -210,6 +210,8 @@ function enqueue_comment_hotkeys_js() { /** * Displays error message at bottom of comments. * + * @since 2.5.0 + * * @param string $msg Error Message. Assumed to contain HTML and be sanitized. */ function comment_footer_die( $msg ) { diff --git a/src/wp-admin/includes/file.php b/src/wp-admin/includes/file.php index 40059273ba..0658662126 100644 --- a/src/wp-admin/includes/file.php +++ b/src/wp-admin/includes/file.php @@ -2622,7 +2622,7 @@ function request_filesystem_credentials( $form_post, $type = '', $error = false, <?php if ( isset( $types['ssh'] ) ) { $hidden_class = ''; - if ( 'ssh' !== $connection_type || empty( $connection_type ) ) { + if ( 'ssh' !== $connection_type ) { $hidden_class = ' class="hidden"'; } ?> diff --git a/src/wp-admin/includes/media.php b/src/wp-admin/includes/media.php index 5c0b5d0b38..7d9fd638fb 100644 --- a/src/wp-admin/includes/media.php +++ b/src/wp-admin/includes/media.php @@ -3337,7 +3337,7 @@ function attachment_submitbox_metadata() { $uploaded_by_link = get_edit_user_link( $author->ID ); } ?> - <div class="misc-pub-section misc-pub-uploadedby"> + <div class="misc-pub-section misc-pub-uploadedby word-wrap-break-word"> <?php if ( $uploaded_by_link ) { ?> <?php _e( 'Uploaded by:' ); ?> <a href="<?php echo $uploaded_by_link; ?>"><strong><?php echo $uploaded_by_name; ?></strong></a> <?php } else { ?> diff --git a/src/wp-admin/includes/misc.php b/src/wp-admin/includes/misc.php index 979d237448..23b3f6544e 100644 --- a/src/wp-admin/includes/misc.php +++ b/src/wp-admin/includes/misc.php @@ -263,7 +263,7 @@ function save_mod_rewrite_rules() { global $wp_rewrite; if ( is_multisite() ) { - return; + return null; } // Ensure get_home_path() is declared. @@ -303,7 +303,7 @@ function iis7_save_url_rewrite_rules() { global $wp_rewrite; if ( is_multisite() ) { - return; + return null; } // Ensure get_home_path() is declared. @@ -988,7 +988,7 @@ function saveDomDocument( $doc, $filename ) { // phpcs:ignore WordPress.NamingCo } /** - * Displays the default admin color scheme picker (Used in user-edit.php). + * Displays the default administration color scheme picker (Used in user-edit.php). * * @since 3.0.0 * @@ -1025,7 +1025,7 @@ function admin_color_scheme_picker( $user_id ) { <legend class="screen-reader-text"><span> <?php /* translators: Hidden accessibility text. */ - _e( 'Admin Color Scheme' ); + _e( 'Administration Color Scheme' ); ?> </span></legend> <?php @@ -1059,6 +1059,8 @@ function admin_color_scheme_picker( $user_id ) { /** * * @global array $_wp_admin_css_colors + * + * @since 3.8.0 */ function wp_color_scheme_settings() { global $_wp_admin_css_colors; diff --git a/src/wp-admin/includes/ms.php b/src/wp-admin/includes/ms.php index fc5f54a7f4..10ed2e2769 100644 --- a/src/wp-admin/includes/ms.php +++ b/src/wp-admin/includes/ms.php @@ -854,6 +854,8 @@ var tb_pathToImage = "<?php echo esc_js( includes_url( 'js/thickbox/loadingAnima } /** + * @since 3.0.0 + * * @param array $users * @return bool */ diff --git a/src/wp-admin/includes/post.php b/src/wp-admin/includes/post.php index 40fac43d6e..ebdd61df34 100644 --- a/src/wp-admin/includes/post.php +++ b/src/wp-admin/includes/post.php @@ -2186,7 +2186,7 @@ function wp_autosave( $post_data ) { * * @param int $post_id Optional. Post ID. */ -function redirect_post( $post_id = '' ) { +function redirect_post( $post_id = 0 ) { if ( isset( $_POST['save'] ) || isset( $_POST['publish'] ) ) { $status = get_post_status( $post_id ); diff --git a/src/wp-admin/includes/revision.php b/src/wp-admin/includes/revision.php index df7201e958..ec2460c0ca 100644 --- a/src/wp-admin/includes/revision.php +++ b/src/wp-admin/includes/revision.php @@ -407,41 +407,43 @@ function wp_print_revision_templates() { <strong id="diff-title-to"><?php _ex( 'To:', 'Followed by post revision info' ); ?></strong> <# } #> <div class="author-card<# if ( data.attributes.autosave ) { #> autosave<# } #>"> - {{{ data.attributes.author.avatar }}} - <div class="author-info" id="diff-title-author"> - <# if ( data.attributes.autosave ) { #> - <span class="byline"> - <?php - printf( - /* translators: %s: User's display name. */ - __( 'Autosave by %s' ), - '<span class="author-name">{{ data.attributes.author.name }}</span>' - ); - ?> - </span> - <# } else if ( data.attributes.current ) { #> - <span class="byline"> - <?php - printf( - /* translators: %s: User's display name. */ - __( 'Current Revision by %s' ), - '<span class="author-name">{{ data.attributes.author.name }}</span>' - ); - ?> - </span> - <# } else { #> - <span class="byline"> - <?php - printf( - /* translators: %s: User's display name. */ - __( 'Revision by %s' ), - '<span class="author-name">{{ data.attributes.author.name }}</span>' - ); - ?> - </span> - <# } #> - <span class="time-ago">{{ data.attributes.timeAgo }}</span> - <span class="date">({{ data.attributes.dateShort }})</span> + <div> + {{{ data.attributes.author.avatar }}} + <div class="author-info" id="diff-title-author"> + <# if ( data.attributes.autosave ) { #> + <span class="byline"> + <?php + printf( + /* translators: %s: User's display name. */ + __( 'Autosave by %s' ), + '<span class="author-name">{{ data.attributes.author.name }}</span>' + ); + ?> + </span> + <# } else if ( data.attributes.current ) { #> + <span class="byline"> + <?php + printf( + /* translators: %s: User's display name. */ + __( 'Current Revision by %s' ), + '<span class="author-name">{{ data.attributes.author.name }}</span>' + ); + ?> + </span> + <# } else { #> + <span class="byline"> + <?php + printf( + /* translators: %s: User's display name. */ + __( 'Revision by %s' ), + '<span class="author-name">{{ data.attributes.author.name }}</span>' + ); + ?> + </span> + <# } #> + <span class="time-ago">{{ data.attributes.timeAgo }}</span> + <span class="date">({{ data.attributes.dateShort }})</span> + </div> </div> <# if ( 'to' === data.type && data.attributes.restoreUrl ) { #> <input <?php if ( wp_check_post_lock( $post->ID ) ) { ?> diff --git a/src/wp-admin/includes/schema.php b/src/wp-admin/includes/schema.php index 011895f06c..6c15a4d99f 100644 --- a/src/wp-admin/includes/schema.php +++ b/src/wp-admin/includes/schema.php @@ -446,7 +446,7 @@ function populate_options( array $options = array() ) { 'moderation_keys' => '', 'active_plugins' => array(), 'category_base' => '', - 'ping_sites' => 'http://rpc.pingomatic.com/', + 'ping_sites' => 'https://rpc.pingomatic.com/', 'comment_max_links' => 2, 'gmt_offset' => $gmt_offset, diff --git a/src/wp-admin/includes/taxonomy.php b/src/wp-admin/includes/taxonomy.php index 7765084fa7..359cfafe2f 100644 --- a/src/wp-admin/includes/taxonomy.php +++ b/src/wp-admin/includes/taxonomy.php @@ -75,7 +75,7 @@ function wp_create_category( $cat_name, $category_parent = 0 ) { * @param int $post_id Optional. The post ID. Default empty. * @return int[] Array of IDs of categories assigned to the given post. */ -function wp_create_categories( $categories, $post_id = '' ) { +function wp_create_categories( $categories, $post_id = 0 ) { $cat_ids = array(); foreach ( $categories as $category ) { $id = category_exists( $category ); diff --git a/src/wp-admin/includes/template.php b/src/wp-admin/includes/template.php index 127027d8f5..43e3442b00 100644 --- a/src/wp-admin/includes/template.php +++ b/src/wp-admin/includes/template.php @@ -817,9 +817,6 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) { $tab_index_attribute = " tabindex=\"$tab_index\""; } - // @todo Remove this? - // 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 />'; - $post_date = ( $for_post ) ? $post->post_date : get_comment()->comment_date; $jj = ( $edit ) ? mysql2date( 'd', $post_date, false ) : current_time( 'd' ); $mm = ( $edit ) ? mysql2date( 'm', $post_date, false ) : current_time( 'm' ); @@ -2635,6 +2632,8 @@ function get_submit_button( $text = '', $type = 'primary large', $name = 'submit * Prints out the beginning of the admin HTML header. * * @global bool $is_IE + * + * @since 3.3.0 */ function _wp_admin_html_begin() { global $is_IE; diff --git a/src/wp-admin/includes/update-core.php b/src/wp-admin/includes/update-core.php index f1731f9c8f..2d925afa63 100644 --- a/src/wp-admin/includes/update-core.php +++ b/src/wp-admin/includes/update-core.php @@ -1023,6 +1023,7 @@ $_new_bundled_files = array( * @global string[] $_old_requests_files * @global string[] $_new_bundled_files * @global wpdb $wpdb WordPress database abstraction object. + * @global string $wp_version The WordPress version string. * * @param string $from New release unzipped path. * @param string $to Path to old WordPress installation. diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php index d8d3248edb..9b91ef5762 100644 --- a/src/wp-admin/includes/upgrade.php +++ b/src/wp-admin/includes/upgrade.php @@ -208,7 +208,7 @@ if ( ! function_exists( 'wp_install_defaults' ) ) : // First post. $now = current_time( 'mysql' ); - $now_gmt = current_time( 'mysql', 1 ); + $now_gmt = current_time( 'mysql', true ); $first_post_guid = get_option( 'home' ) . '/?p=1'; if ( is_multisite() ) { @@ -881,6 +881,11 @@ function upgrade_all() { if ( $wp_current_db_version < 58975 ) { upgrade_670(); } + + if ( $wp_current_db_version < 60421 ) { + upgrade_682(); + } + maybe_disable_link_manager(); maybe_disable_automattic_widgets(); @@ -2439,6 +2444,42 @@ function upgrade_670() { wp_set_options_autoload( $options, false ); } } + +/** + * Executes changes made in WordPress 6.8.2. + * + * @ignore + * @since 6.8.2 + * + * @global int $wp_current_db_version The old (current) database version. + */ +function upgrade_682() { + global $wp_current_db_version; + + if ( $wp_current_db_version < 60421 ) { + // Upgrade Ping-O-Matic and Twingly to use HTTPS. + $ping_sites_value = get_option( 'ping_sites' ); + $ping_sites_value = explode( "\n", $ping_sites_value ); + $ping_sites_value = array_map( + function ( $url ) { + $url = trim( $url ); + $url = sanitize_url( $url ); + if ( + str_ends_with( trailingslashit( $url ), '://rpc.pingomatic.com/' ) + || str_ends_with( trailingslashit( $url ), '://rpc.twingly.com/' ) + ) { + $url = set_url_scheme( $url, 'https' ); + } + return $url; + }, + $ping_sites_value + ); + $ping_sites_value = array_filter( $ping_sites_value ); + $ping_sites_value = implode( "\n", $ping_sites_value ); + update_option( 'ping_sites', $ping_sites_value ); + } +} + /** * Executes network-level upgrade routines. * |