Changeset 56176
- Timestamp:
- 07/09/2023 08:05:43 PM (16 months ago)
- Location:
- trunk/src/wp-admin/includes
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ms.php
r55753 r56176 1006 1006 var languageSelect = $( '#WPLANG' ); 1007 1007 $( 'form' ).on( 'submit', function() { 1008 // Don't show a spinner for English and installed languages, 1009 // as there is nothing to download. 1008 /* 1009 * Don't show a spinner for English and installed languages, 1010 * as there is nothing to download. 1011 */ 1010 1012 if ( ! languageSelect.find( 'option:selected' ).data( 'installed' ) ) { 1011 1013 $( '#submit', this ).after( '<span class="spinner language-install-spinner is-active" />' ); -
trunk/src/wp-admin/includes/nav-menu.php
r55616 r56176 1503 1503 if ( ! is_null( $data ) && $data ) { 1504 1504 foreach ( $data as $post_input_data ) { 1505 // For input names that are arrays (e.g. `menu-item-db-id[3][4][5]`), 1506 // derive the array path keys via regex and set the value in $_POST. 1505 /* 1506 * For input names that are arrays (e.g. `menu-item-db-id[3][4][5]`), 1507 * derive the array path keys via regex and set the value in $_POST. 1508 */ 1507 1509 preg_match( '#([^\[]*)(\[(.+)\])?#', $post_input_data->name, $matches ); 1508 1510 -
trunk/src/wp-admin/includes/options.php
r55414 r56176 91 91 var languageSelect = $( '#WPLANG' ); 92 92 $( 'form' ).on( 'submit', function() { 93 // Don't show a spinner for English and installed languages, 94 // as there is nothing to download. 93 /* 94 * Don't show a spinner for English and installed languages, 95 * as there is nothing to download. 96 */ 95 97 if ( ! languageSelect.find( 'option:selected' ).data( 'installed' ) ) { 96 98 $( '#submit', this ).after( '<span class="spinner language-install-spinner is-active" />' ); -
trunk/src/wp-admin/includes/plugin-install.php
r55276 r56176 487 487 } else { 488 488 $key = array_keys( $installed_plugin ); 489 // Use the first plugin regardless of the name. 490 // Could have issues for multiple plugins in one directory if they share different version numbers. 489 /* 490 * Use the first plugin regardless of the name. 491 * Could have issues for multiple plugins in one directory if they share different version numbers. 492 */ 491 493 $key = reset( $key ); 492 494 -
trunk/src/wp-admin/includes/plugin.php
r55990 r56176 179 179 ); 180 180 181 // Name is marked up inside <a> tags. Don't allow these. 182 // Author is too, but some plugins have used <a> here (omitting Author URI). 181 /* 182 * Name is marked up inside <a> tags. Don't allow these. 183 * Author is too, but some plugins have used <a> here (omitting Author URI). 184 */ 183 185 $plugin_data['Name'] = wp_kses( $plugin_data['Name'], $allowed_tags_in_links ); 184 186 $plugin_data['Author'] = wp_kses( $plugin_data['Author'], $allowed_tags ); … … 970 972 $this_plugin_dir = trailingslashit( dirname( $plugins_dir . $plugin_file ) ); 971 973 972 // If plugin is in its own directory, recursively delete the directory. 973 // Base check on if plugin includes directory separator AND that it's not the root plugin folder. 974 /* 975 * If plugin is in its own directory, recursively delete the directory. 976 * Base check on if plugin includes directory separator AND that it's not the root plugin folder. 977 */ 974 978 if ( strpos( $plugin_file, '/' ) && $this_plugin_dir !== $plugins_dir ) { 975 979 $deleted = $wp_filesystem->delete( $this_plugin_dir, true ); -
trunk/src/wp-admin/includes/post.php
r56123 r56176 136 136 $published_statuses = array( 'publish', 'future' ); 137 137 138 // Posts 'submitted for approval' are submitted to $_POST the same as if they were being published. 139 // Change status from 'publish' to 'pending' if user lacks permissions to publish or to resave published posts. 138 /* 139 * Posts 'submitted for approval' are submitted to $_POST the same as if they were being published. 140 * Change status from 'publish' to 'pending' if user lacks permissions to publish or to resave published posts. 141 */ 140 142 if ( isset( $post_data['post_status'] ) 141 143 && ( in_array( $post_data['post_status'], $published_statuses, true ) … … 1444 1446 } 1445 1447 1446 // If the user wants to set a new name -- override the current one. 1447 // Note: if empty name is supplied -- use the title instead, see #6072. 1448 /* 1449 * If the user wants to set a new name -- override the current one. 1450 * Note: if empty name is supplied -- use the title instead, see #6072. 1451 */ 1448 1452 if ( ! is_null( $name ) ) { 1449 1453 $post->post_name = sanitize_title( $name ? $name : $title, $post->ID ); … … 2074 2078 return edit_post( wp_slash( $post_data ) ); 2075 2079 } else { 2076 // Non-drafts or other users' drafts are not overwritten. 2077 // The autosave is stored in a special post revision for each user. 2080 /* 2081 * Non-drafts or other users' drafts are not overwritten. 2082 * The autosave is stored in a special post revision for each user. 2083 */ 2078 2084 return wp_create_post_autosave( wp_slash( $post_data ) ); 2079 2085 } -
trunk/src/wp-admin/includes/revision.php
r54939 r56176 40 40 } 41 41 42 // If comparing revisions, make sure we're dealing with the right post parent. 43 // The parent post may be a 'revision' when revisions are disabled and we're looking at autosaves. 42 /* 43 * If comparing revisions, make sure we are dealing with the right post parent. 44 * The parent post may be a 'revision' when revisions are disabled and we're looking at autosaves. 45 */ 44 46 if ( $compare_from && $compare_from->post_parent !== $post->ID && $compare_from->ID !== $post->ID ) { 45 47 return false; … … 119 121 120 122 if ( ! $diff && 'post_title' === $field ) { 121 // It's a better user experience to still show the Title, even if it didn't change. 122 // No, you didn't see this. 123 /* 124 * It's a better user experience to still show the Title, even if it didn't change. 125 * No, you didn't see this. 126 */ 123 127 $diff = '<table class="diff"><colgroup><col class="content diffsplit left"><col class="content diffsplit middle"><col class="content diffsplit right"></colgroup><tbody><tr>'; 124 128 -
trunk/src/wp-admin/includes/schema.php
r55869 r56176 549 549 'auto_update_core_dev' => 'enabled', 550 550 'auto_update_core_minor' => 'enabled', 551 // Default to enabled for new installs. 552 // See https://core.trac.wordpress.org/ticket/51742. 551 /* 552 * Default to enabled for new installs. 553 * See https://core.trac.wordpress.org/ticket/51742. 554 */ 553 555 'auto_update_core_major' => 'enabled', 554 556 -
trunk/src/wp-admin/includes/template.php
r56018 r56176 166 166 167 167 if ( $parsed_args['checked_ontop'] ) { 168 // Post-process $categories rather than adding an exclude to the get_terms() query 169 // to keep the query the same across all posts (for any query cache). 168 /* 169 * Post-process $categories rather than adding an exclude to the get_terms() query 170 * to keep the query the same across all posts (for any query cache). 171 */ 170 172 $checked_categories = array(); 171 173 $keys = array_keys( $categories ); … … 1302 1304 printf( '<div id="%s-sortables" class="meta-box-sortables">', esc_attr( $context ) ); 1303 1305 1304 // Grab the ones the user has manually sorted. 1305 // Pull them out of their previous context/priority and into the one the user chose. 1306 /* 1307 * Grab the ones the user has manually sorted. 1308 * Pull them out of their previous context/priority and into the one the user chose. 1309 */ 1306 1310 $sorted = get_user_option( "meta-box-order_$page" ); 1307 1311 -
trunk/src/wp-admin/includes/update-core.php
r56088 r56176 1230 1230 apply_filters( 'update_feedback', __( 'Preparing to install the latest version…' ) ); 1231 1231 1232 // Don't copy wp-content, we'll deal with that below. 1233 // We also copy version.php last so failed updates report their old version. 1232 /* 1233 * Don't copy wp-content, we'll deal with that below. 1234 * We also copy version.php last so failed updates report their old version. 1235 */ 1234 1236 $skip = array( 'wp-content', 'wp-includes/version.php' ); 1235 1237 $check_is_writable = array(); … … 1398 1400 } 1399 1401 1400 // If we don't have enough free space, it isn't worth trying again. 1401 // Unlikely to be hit due to the check in unzip_file(). 1402 /* 1403 * If we don't have enough free space, it isn't worth trying again. 1404 * Unlikely to be hit due to the check in unzip_file(). 1405 */ 1402 1406 $available_space = function_exists( 'disk_free_space' ) ? @disk_free_space( ABSPATH ) : false; 1403 1407 … … 1417 1421 } 1418 1422 1419 // Custom content directory needs updating now. 1420 // Copy languages. 1423 /* 1424 * Custom content directory needs updating now. 1425 * Copy languages. 1426 */ 1421 1427 if ( ! is_wp_error( $result ) && $wp_filesystem->is_dir( $from . $distro . 'wp-content/languages' ) ) { 1422 1428 if ( WP_LANG_DIR !== ABSPATH . WPINC . '/languages' || @is_dir( WP_LANG_DIR ) ) { … … 1456 1462 $wp_filesystem->delete( $maintenance_file ); 1457 1463 1458 // 3.5 -> 3.5+ - an empty twentytwelve directory was created upon upgrade to 3.5 for some users, 1459 // preventing installation of Twenty Twelve. 1464 /* 1465 * 3.5 -> 3.5+ - an empty twentytwelve directory was created upon upgrade to 3.5 for some users, 1466 * preventing installation of Twenty Twelve. 1467 */ 1460 1468 if ( '3.5' === $old_wp_version ) { 1461 1469 if ( is_dir( WP_CONTENT_DIR . '/themes/twentytwelve' ) -
trunk/src/wp-admin/includes/upgrade.php
r56044 r56176 441 441 $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->usermeta WHERE user_id != %d AND meta_key = %s", $user_id, $table_prefix . 'capabilities' ) ); 442 442 443 // Delete any caps that snuck into the previously active blog. (Hardcoded to blog 1 for now.) 444 // TODO: Get previous_blog_id. 443 /* 444 * Delete any caps that snuck into the previously active blog. (Hardcoded to blog 1 for now.) 445 * TODO: Get previous_blog_id. 446 */ 445 447 if ( ! is_super_admin( $user_id ) && 1 != $user_id ) { 446 448 $wpdb->delete( … … 1645 1647 1646 1648 if ( $wp_current_db_version < 11958 ) { 1647 // Previously, setting depth to 1 would redundantly disable threading, 1648 // but now 2 is the minimum depth to avoid confusion. 1649 /* 1650 * Previously, setting depth to 1 would redundantly disable threading, 1651 * but now 2 is the minimum depth to avoid confusion. 1652 */ 1649 1653 if ( get_option( 'thread_comments_depth' ) == '1' ) { 1650 1654 update_option( 'thread_comments_depth', 2 ); … … 3332 3336 $default_dir = WP_CONTENT_DIR . '/themes/' . WP_DEFAULT_THEME; 3333 3337 3334 // Copy files from the default theme to the site theme. 3335 // $files = array( 'index.php', 'comments.php', 'comments-popup.php', 'footer.php', 'header.php', 'sidebar.php', 'style.css' ); 3338 /* 3339 * Copy files from the default theme to the site theme. 3340 * $files = array( 'index.php', 'comments.php', 'comments-popup.php', 'footer.php', 'header.php', 'sidebar.php', 'style.css' ); 3341 */ 3336 3342 3337 3343 $theme_dir = @opendir( $default_dir );
Note: See TracChangeset
for help on using the changeset viewer.