wip
This commit is contained in:
@@ -690,18 +690,21 @@ function _wp_ajax_add_hierarchical_term() {
|
||||
);
|
||||
}
|
||||
|
||||
$parent_dropdown_args = array(
|
||||
'taxonomy' => $taxonomy->name,
|
||||
'hide_empty' => 0,
|
||||
'name' => 'new' . $taxonomy->name . '_parent',
|
||||
'orderby' => 'name',
|
||||
'hierarchical' => 1,
|
||||
'show_option_none' => '— ' . $taxonomy->labels->parent_item . ' —',
|
||||
);
|
||||
|
||||
/** This filter is documented in wp-admin/includes/meta-boxes.php */
|
||||
$parent_dropdown_args = apply_filters( 'post_edit_category_parent_dropdown_args', $parent_dropdown_args );
|
||||
|
||||
ob_start();
|
||||
|
||||
wp_dropdown_categories(
|
||||
array(
|
||||
'taxonomy' => $taxonomy->name,
|
||||
'hide_empty' => 0,
|
||||
'name' => 'new' . $taxonomy->name . '_parent',
|
||||
'orderby' => 'name',
|
||||
'hierarchical' => 1,
|
||||
'show_option_none' => '— ' . $taxonomy->labels->parent_item . ' —',
|
||||
)
|
||||
);
|
||||
wp_dropdown_categories( $parent_dropdown_args );
|
||||
|
||||
$sup = ob_get_clean();
|
||||
|
||||
@@ -2114,7 +2117,7 @@ function wp_ajax_inline_save() {
|
||||
if ( isset( $data['keep_private'] ) && 'private' === $data['keep_private'] ) {
|
||||
$data['visibility'] = 'private';
|
||||
$data['post_status'] = 'private';
|
||||
} else {
|
||||
} elseif ( isset( $data['_status'] ) ) {
|
||||
$data['post_status'] = $data['_status'];
|
||||
}
|
||||
|
||||
@@ -5354,7 +5357,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 +5390,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 +5423,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 +5473,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'
|
||||
|
||||
@@ -377,6 +377,8 @@ class Custom_Background {
|
||||
<input name="background-preset" type="hidden" value="custom">
|
||||
|
||||
<?php
|
||||
$background_position_title = __( 'Image Position' );
|
||||
|
||||
$background_position = sprintf(
|
||||
'%s %s',
|
||||
get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) ),
|
||||
@@ -429,13 +431,8 @@ class Custom_Background {
|
||||
);
|
||||
?>
|
||||
<tr>
|
||||
<th scope="row"><?php _e( 'Image Position' ); ?></th>
|
||||
<td><fieldset><legend class="screen-reader-text"><span>
|
||||
<?php
|
||||
/* translators: Hidden accessibility text. */
|
||||
_e( 'Image Position' );
|
||||
?>
|
||||
</span></legend>
|
||||
<th scope="row"><?php echo $background_position_title; ?></th>
|
||||
<td><fieldset><legend class="screen-reader-text"><span><?php echo $background_position_title; ?></span></legend>
|
||||
<div class="background-position-control">
|
||||
<?php foreach ( $background_position_options as $group ) : ?>
|
||||
<div class="button-group">
|
||||
@@ -452,14 +449,10 @@ class Custom_Background {
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
|
||||
<?php $image_size_title = __( 'Image Size' ); ?>
|
||||
<tr>
|
||||
<th scope="row"><label for="background-size"><?php _e( 'Image Size' ); ?></label></th>
|
||||
<td><fieldset><legend class="screen-reader-text"><span>
|
||||
<?php
|
||||
/* translators: Hidden accessibility text. */
|
||||
_e( 'Image Size' );
|
||||
?>
|
||||
</span></legend>
|
||||
<th scope="row"><label for="background-size"><?php echo $image_size_title; ?></label></th>
|
||||
<td><fieldset><legend class="screen-reader-text"><span><?php echo $image_size_title; ?></span></legend>
|
||||
<select id="background-size" name="background-size">
|
||||
<option value="auto"<?php selected( 'auto', get_theme_mod( 'background_size', get_theme_support( 'custom-background', 'default-size' ) ) ); ?>><?php _ex( 'Original', 'Original Size' ); ?></option>
|
||||
<option value="contain"<?php selected( 'contain', get_theme_mod( 'background_size', get_theme_support( 'custom-background', 'default-size' ) ) ); ?>><?php _e( 'Fit to Screen' ); ?></option>
|
||||
@@ -468,40 +461,29 @@ class Custom_Background {
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
|
||||
<?php $background_repeat_title = _x( 'Repeat', 'Background Repeat' ); ?>
|
||||
<tr>
|
||||
<th scope="row"><?php _ex( 'Repeat', 'Background Repeat' ); ?></th>
|
||||
<td><fieldset><legend class="screen-reader-text"><span>
|
||||
<?php
|
||||
/* translators: Hidden accessibility text. */
|
||||
_ex( 'Repeat', 'Background Repeat' );
|
||||
?>
|
||||
</span></legend>
|
||||
<th scope="row"><?php echo $background_repeat_title; ?></th>
|
||||
<td><fieldset><legend class="screen-reader-text"><span><?php echo $background_repeat_title; ?></span></legend>
|
||||
<input name="background-repeat" type="hidden" value="no-repeat">
|
||||
<label><input type="checkbox" name="background-repeat" value="repeat"<?php checked( 'repeat', get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) ) ); ?>> <?php _e( 'Repeat Background Image' ); ?></label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
|
||||
<?php $background_scroll_title = _x( 'Scroll', 'Background Scroll' ); ?>
|
||||
<tr>
|
||||
<th scope="row"><?php _ex( 'Scroll', 'Background Scroll' ); ?></th>
|
||||
<td><fieldset><legend class="screen-reader-text"><span>
|
||||
<?php
|
||||
/* translators: Hidden accessibility text. */
|
||||
_ex( 'Scroll', 'Background Scroll' );
|
||||
?>
|
||||
</span></legend>
|
||||
<th scope="row"><?php echo $background_scroll_title; ?></th>
|
||||
<td><fieldset><legend class="screen-reader-text"><span><?php echo $background_scroll_title; ?></span></legend>
|
||||
<input name="background-attachment" type="hidden" value="fixed">
|
||||
<label><input name="background-attachment" type="checkbox" value="scroll" <?php checked( 'scroll', get_theme_mod( 'background_attachment', get_theme_support( 'custom-background', 'default-attachment' ) ) ); ?>> <?php _e( 'Scroll with Page' ); ?></label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
<?php endif; // get_background_image() ?>
|
||||
|
||||
<?php $background_color_title = __( 'Background Color' ); ?>
|
||||
<tr>
|
||||
<th scope="row"><?php _e( 'Background Color' ); ?></th>
|
||||
<td><fieldset><legend class="screen-reader-text"><span>
|
||||
<?php
|
||||
/* translators: Hidden accessibility text. */
|
||||
_e( 'Background Color' );
|
||||
?>
|
||||
</span></legend>
|
||||
<th scope="row"><?php echo $background_color_title; ?></th>
|
||||
<td><fieldset><legend class="screen-reader-text"><span><?php echo $background_color_title; ?></span></legend>
|
||||
<?php
|
||||
$default_color = '';
|
||||
if ( current_theme_supports( 'custom-background', 'default-color' ) ) {
|
||||
|
||||
@@ -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' ) )
|
||||
) {
|
||||
@@ -1547,8 +1547,8 @@ endif;
|
||||
|
||||
$already_has_default = false;
|
||||
|
||||
foreach ( $this->default_headers as $k => $h ) {
|
||||
if ( $h['url'] === $default ) {
|
||||
foreach ( $this->default_headers as $k => $header ) {
|
||||
if ( $header['url'] === $default ) {
|
||||
$already_has_default = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -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':
|
||||
|
||||
@@ -206,7 +206,7 @@ class Plugin_Upgrader extends WP_Upgrader {
|
||||
}
|
||||
|
||||
// Get the URL to the zip file.
|
||||
$r = $current->response[ $plugin ];
|
||||
$upgrade_data = $current->response[ $plugin ];
|
||||
|
||||
add_filter( 'upgrader_pre_install', array( $this, 'deactivate_plugin_before_upgrade' ), 10, 2 );
|
||||
add_filter( 'upgrader_pre_install', array( $this, 'active_before' ), 10, 2 );
|
||||
@@ -223,7 +223,7 @@ class Plugin_Upgrader extends WP_Upgrader {
|
||||
|
||||
$this->run(
|
||||
array(
|
||||
'package' => $r->package,
|
||||
'package' => $upgrade_data->package,
|
||||
'destination' => WP_PLUGIN_DIR,
|
||||
'clear_destination' => true,
|
||||
'clear_working' => true,
|
||||
@@ -301,8 +301,8 @@ class Plugin_Upgrader extends WP_Upgrader {
|
||||
$this->skin->header();
|
||||
|
||||
// Connect to the filesystem first.
|
||||
$res = $this->fs_connect( array( WP_CONTENT_DIR, WP_PLUGIN_DIR ) );
|
||||
if ( ! $res ) {
|
||||
$connected = $this->fs_connect( array( WP_CONTENT_DIR, WP_PLUGIN_DIR ) );
|
||||
if ( ! $connected ) {
|
||||
$this->skin->footer();
|
||||
return false;
|
||||
}
|
||||
@@ -341,32 +341,32 @@ class Plugin_Upgrader extends WP_Upgrader {
|
||||
}
|
||||
|
||||
// Get the URL to the zip file.
|
||||
$r = $current->response[ $plugin ];
|
||||
$upgrade_data = $current->response[ $plugin ];
|
||||
|
||||
$this->skin->plugin_active = is_plugin_active( $plugin );
|
||||
|
||||
if ( isset( $r->requires ) && ! is_wp_version_compatible( $r->requires ) ) {
|
||||
if ( isset( $upgrade_data->requires ) && ! is_wp_version_compatible( $upgrade_data->requires ) ) {
|
||||
$result = new WP_Error(
|
||||
'incompatible_wp_required_version',
|
||||
sprintf(
|
||||
/* translators: 1: Current WordPress version, 2: WordPress version required by the new plugin version. */
|
||||
__( 'Your WordPress version is %1$s, however the new plugin version requires %2$s.' ),
|
||||
$wp_version,
|
||||
$r->requires
|
||||
$upgrade_data->requires
|
||||
)
|
||||
);
|
||||
|
||||
$this->skin->before( $result );
|
||||
$this->skin->error( $result );
|
||||
$this->skin->after();
|
||||
} elseif ( isset( $r->requires_php ) && ! is_php_version_compatible( $r->requires_php ) ) {
|
||||
} elseif ( isset( $upgrade_data->requires_php ) && ! is_php_version_compatible( $upgrade_data->requires_php ) ) {
|
||||
$result = new WP_Error(
|
||||
'incompatible_php_required_version',
|
||||
sprintf(
|
||||
/* translators: 1: Current PHP version, 2: PHP version required by the new plugin version. */
|
||||
__( 'The PHP version on your server is %1$s, however the new plugin version requires %2$s.' ),
|
||||
PHP_VERSION,
|
||||
$r->requires_php
|
||||
$upgrade_data->requires_php
|
||||
)
|
||||
);
|
||||
|
||||
@@ -377,7 +377,7 @@ class Plugin_Upgrader extends WP_Upgrader {
|
||||
add_filter( 'upgrader_source_selection', array( $this, 'check_package' ) );
|
||||
$result = $this->run(
|
||||
array(
|
||||
'package' => $r->package,
|
||||
'package' => $upgrade_data->package,
|
||||
'destination' => WP_PLUGIN_DIR,
|
||||
'clear_destination' => true,
|
||||
'clear_working' => true,
|
||||
@@ -478,9 +478,9 @@ class Plugin_Upgrader extends WP_Upgrader {
|
||||
$files = glob( $working_directory . '*.php' );
|
||||
if ( $files ) {
|
||||
foreach ( $files as $file ) {
|
||||
$info = get_plugin_data( $file, false, false );
|
||||
if ( ! empty( $info['Name'] ) ) {
|
||||
$this->new_plugin_data = $info;
|
||||
$new_plugin_data = get_plugin_data( $file, false, false );
|
||||
if ( ! empty( $new_plugin_data['Name'] ) ) {
|
||||
$this->new_plugin_data = $new_plugin_data;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -490,8 +490,8 @@ class Plugin_Upgrader extends WP_Upgrader {
|
||||
return new WP_Error( 'incompatible_archive_no_plugins', $this->strings['incompatible_archive'], __( 'No valid plugins were found.' ) );
|
||||
}
|
||||
|
||||
$requires_php = isset( $info['RequiresPHP'] ) ? $info['RequiresPHP'] : null;
|
||||
$requires_wp = isset( $info['RequiresWP'] ) ? $info['RequiresWP'] : null;
|
||||
$requires_php = isset( $new_plugin_data['RequiresPHP'] ) ? $new_plugin_data['RequiresPHP'] : null;
|
||||
$requires_wp = isset( $new_plugin_data['RequiresWP'] ) ? $new_plugin_data['RequiresWP'] : null;
|
||||
|
||||
if ( ! is_php_version_compatible( $requires_php ) ) {
|
||||
$error = sprintf(
|
||||
@@ -542,9 +542,9 @@ class Plugin_Upgrader extends WP_Upgrader {
|
||||
}
|
||||
|
||||
// Assume the requested plugin is the first in the list.
|
||||
$pluginfiles = array_keys( $plugin );
|
||||
$plugin_files = array_keys( $plugin );
|
||||
|
||||
return $this->result['destination_name'] . '/' . $pluginfiles[0];
|
||||
return $this->result['destination_name'] . '/' . $plugin_files[0];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -121,14 +121,24 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin {
|
||||
|
||||
$install_actions = array();
|
||||
|
||||
if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) && ! $theme_info->is_block_theme() ) {
|
||||
$customize_url = add_query_arg(
|
||||
array(
|
||||
'theme' => urlencode( $stylesheet ),
|
||||
'return' => urlencode( admin_url( 'web' === $this->type ? 'theme-install.php' : 'themes.php' ) ),
|
||||
),
|
||||
admin_url( 'customize.php' )
|
||||
);
|
||||
if ( current_user_can( 'edit_theme_options' ) && ( $theme_info->is_block_theme() || current_user_can( 'customize' ) ) ) {
|
||||
if ( $theme_info->is_block_theme() ) {
|
||||
$customize_url = add_query_arg(
|
||||
array(
|
||||
'wp_theme_preview' => urlencode( $stylesheet ),
|
||||
'return' => urlencode( admin_url( 'web' === $this->type ? 'theme-install.php' : 'themes.php' ) ),
|
||||
),
|
||||
admin_url( 'site-editor.php' )
|
||||
);
|
||||
} else {
|
||||
$customize_url = add_query_arg(
|
||||
array(
|
||||
'theme' => urlencode( $stylesheet ),
|
||||
'return' => urlencode( admin_url( 'web' === $this->type ? 'theme-install.php' : 'themes.php' ) ),
|
||||
),
|
||||
admin_url( 'customize.php' )
|
||||
);
|
||||
}
|
||||
|
||||
$install_actions['preview'] = sprintf(
|
||||
'<a href="%s" class="hide-if-no-customize load-customize">' .
|
||||
|
||||
@@ -311,7 +311,7 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
return false;
|
||||
}
|
||||
|
||||
$r = $current->response[ $theme ];
|
||||
$upgrade_data = $current->response[ $theme ];
|
||||
|
||||
add_filter( 'upgrader_pre_install', array( $this, 'current_before' ), 10, 2 );
|
||||
add_filter( 'upgrader_post_install', array( $this, 'current_after' ), 10, 2 );
|
||||
@@ -323,7 +323,7 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
|
||||
$this->run(
|
||||
array(
|
||||
'package' => $r['package'],
|
||||
'package' => $upgrade_data['package'],
|
||||
'destination' => get_theme_root( $theme ),
|
||||
'clear_destination' => true,
|
||||
'clear_working' => true,
|
||||
@@ -400,8 +400,8 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
$this->skin->header();
|
||||
|
||||
// Connect to the filesystem first.
|
||||
$res = $this->fs_connect( array( WP_CONTENT_DIR ) );
|
||||
if ( ! $res ) {
|
||||
$connected = $this->fs_connect( array( WP_CONTENT_DIR ) );
|
||||
if ( ! $connected ) {
|
||||
$this->skin->footer();
|
||||
return false;
|
||||
}
|
||||
@@ -441,30 +441,30 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
}
|
||||
|
||||
// Get the URL to the zip file.
|
||||
$r = $current->response[ $theme ];
|
||||
$upgrade_data = $current->response[ $theme ];
|
||||
|
||||
if ( isset( $r['requires'] ) && ! is_wp_version_compatible( $r['requires'] ) ) {
|
||||
if ( isset( $upgrade_data['requires'] ) && ! is_wp_version_compatible( $upgrade_data['requires'] ) ) {
|
||||
$result = new WP_Error(
|
||||
'incompatible_wp_required_version',
|
||||
sprintf(
|
||||
/* translators: 1: Current WordPress version, 2: WordPress version required by the new theme version. */
|
||||
__( 'Your WordPress version is %1$s, however the new theme version requires %2$s.' ),
|
||||
$wp_version,
|
||||
$r['requires']
|
||||
$upgrade_data['requires']
|
||||
)
|
||||
);
|
||||
|
||||
$this->skin->before( $result );
|
||||
$this->skin->error( $result );
|
||||
$this->skin->after();
|
||||
} elseif ( isset( $r['requires_php'] ) && ! is_php_version_compatible( $r['requires_php'] ) ) {
|
||||
} elseif ( isset( $upgrade_data['requires_php'] ) && ! is_php_version_compatible( $upgrade_data['requires_php'] ) ) {
|
||||
$result = new WP_Error(
|
||||
'incompatible_php_required_version',
|
||||
sprintf(
|
||||
/* translators: 1: Current PHP version, 2: PHP version required by the new theme version. */
|
||||
__( 'The PHP version on your server is %1$s, however the new theme version requires %2$s.' ),
|
||||
PHP_VERSION,
|
||||
$r['requires_php']
|
||||
$upgrade_data['requires_php']
|
||||
)
|
||||
);
|
||||
|
||||
@@ -475,7 +475,7 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
add_filter( 'upgrader_source_selection', array( $this, 'check_package' ) );
|
||||
$result = $this->run(
|
||||
array(
|
||||
'package' => $r['package'],
|
||||
'package' => $upgrade_data['package'],
|
||||
'destination' => get_theme_root( $theme ),
|
||||
'clear_destination' => true,
|
||||
'clear_working' => true,
|
||||
@@ -589,7 +589,7 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
}
|
||||
|
||||
// All these headers are needed on Theme_Installer_Skin::do_overwrite().
|
||||
$info = get_file_data(
|
||||
$new_theme_data = get_file_data(
|
||||
$working_directory . 'style.css',
|
||||
array(
|
||||
'Name' => 'Theme Name',
|
||||
@@ -601,7 +601,7 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
)
|
||||
);
|
||||
|
||||
if ( empty( $info['Name'] ) ) {
|
||||
if ( empty( $new_theme_data['Name'] ) ) {
|
||||
return new WP_Error(
|
||||
'incompatible_archive_theme_no_name',
|
||||
$this->strings['incompatible_archive'],
|
||||
@@ -619,7 +619,7 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
* - block themes require /templates/index.html or block-templates/index.html (deprecated 5.9.0).
|
||||
*/
|
||||
if (
|
||||
empty( $info['Template'] ) &&
|
||||
empty( $new_theme_data['Template'] ) &&
|
||||
! file_exists( $working_directory . 'index.php' ) &&
|
||||
! file_exists( $working_directory . 'templates/index.html' ) &&
|
||||
! file_exists( $working_directory . 'block-templates/index.html' )
|
||||
@@ -639,8 +639,8 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
);
|
||||
}
|
||||
|
||||
$requires_php = isset( $info['RequiresPHP'] ) ? $info['RequiresPHP'] : null;
|
||||
$requires_wp = isset( $info['RequiresWP'] ) ? $info['RequiresWP'] : null;
|
||||
$requires_php = isset( $new_theme_data['RequiresPHP'] ) ? $new_theme_data['RequiresPHP'] : null;
|
||||
$requires_wp = isset( $new_theme_data['RequiresWP'] ) ? $new_theme_data['RequiresWP'] : null;
|
||||
|
||||
if ( ! is_php_version_compatible( $requires_php ) ) {
|
||||
$error = sprintf(
|
||||
@@ -663,7 +663,7 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
return new WP_Error( 'incompatible_wp_required_version', $this->strings['incompatible_archive'], $error );
|
||||
}
|
||||
|
||||
$this->new_theme_data = $info;
|
||||
$this->new_theme_data = $new_theme_data;
|
||||
|
||||
return $source;
|
||||
}
|
||||
|
||||
@@ -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 ) ) . '" />';
|
||||
|
||||
@@ -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; ?>
|
||||
|
||||
@@ -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 ) ) {
|
||||
|
||||
@@ -99,7 +99,11 @@ class WP_Comments_List_Table extends WP_List_Table {
|
||||
$comment_status = 'all';
|
||||
}
|
||||
|
||||
$comment_type = ! empty( $_REQUEST['comment_type'] ) ? $_REQUEST['comment_type'] : '';
|
||||
$comment_type = '';
|
||||
|
||||
if ( ! empty( $_REQUEST['comment_type'] ) && 'note' !== $_REQUEST['comment_type'] ) {
|
||||
$comment_type = $_REQUEST['comment_type'];
|
||||
}
|
||||
|
||||
$search = ( isset( $_REQUEST['s'] ) ) ? $_REQUEST['s'] : '';
|
||||
|
||||
|
||||
@@ -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 ) {
|
||||
|
||||
@@ -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();
|
||||
@@ -1300,6 +1319,7 @@ class WP_Debug_Data {
|
||||
$active_theme = wp_get_theme();
|
||||
$parent_theme = $active_theme->parent();
|
||||
$theme_updates = get_theme_updates();
|
||||
$transient = get_site_transient( 'update_themes' );
|
||||
|
||||
$auto_updates = array();
|
||||
$auto_updates_enabled = wp_is_auto_update_enabled_for_type( 'theme' );
|
||||
@@ -1859,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();
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
|
||||
/**
|
||||
* @since 2.5.0
|
||||
* @var resource
|
||||
* @var FTP\Connection|resource|false
|
||||
*/
|
||||
public $link;
|
||||
|
||||
@@ -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 ) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -29,8 +29,14 @@ class WP_Importer {
|
||||
// Grab all posts in chunks.
|
||||
do {
|
||||
$meta_key = $importer_name . '_' . $blog_id . '_permalink';
|
||||
$sql = $wpdb->prepare( "SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = %s LIMIT %d,%d", $meta_key, $offset, $limit );
|
||||
$results = $wpdb->get_results( $sql );
|
||||
$results = $wpdb->get_results(
|
||||
$wpdb->prepare(
|
||||
"SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = %s LIMIT %d,%d",
|
||||
$meta_key,
|
||||
$offset,
|
||||
$limit
|
||||
)
|
||||
);
|
||||
|
||||
// Increment offset.
|
||||
$offset = ( $limit + $offset );
|
||||
@@ -62,9 +68,12 @@ class WP_Importer {
|
||||
|
||||
// Get count of permalinks.
|
||||
$meta_key = $importer_name . '_' . $blog_id . '_permalink';
|
||||
$sql = $wpdb->prepare( "SELECT COUNT( post_id ) AS cnt FROM $wpdb->postmeta WHERE meta_key = %s", $meta_key );
|
||||
|
||||
$result = $wpdb->get_results( $sql );
|
||||
$result = $wpdb->get_results(
|
||||
$wpdb->prepare(
|
||||
"SELECT COUNT( post_id ) AS cnt FROM $wpdb->postmeta WHERE meta_key = %s",
|
||||
$meta_key
|
||||
)
|
||||
);
|
||||
|
||||
if ( ! empty( $result ) ) {
|
||||
$count = (int) $result[0]->cnt;
|
||||
@@ -91,8 +100,13 @@ class WP_Importer {
|
||||
|
||||
// Grab all comments in chunks.
|
||||
do {
|
||||
$sql = $wpdb->prepare( "SELECT comment_ID, comment_agent FROM $wpdb->comments LIMIT %d,%d", $offset, $limit );
|
||||
$results = $wpdb->get_results( $sql );
|
||||
$results = $wpdb->get_results(
|
||||
$wpdb->prepare(
|
||||
"SELECT comment_ID, comment_agent FROM $wpdb->comments LIMIT %d,%d",
|
||||
$offset,
|
||||
$limit
|
||||
)
|
||||
);
|
||||
|
||||
// Increment offset.
|
||||
$offset = ( $limit + $offset );
|
||||
|
||||
@@ -120,7 +120,7 @@ final class WP_Internal_Pointers {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
(function($){
|
||||
var options = <?php echo wp_json_encode( $args ); ?>, setup;
|
||||
var options = <?php echo wp_json_encode( $args, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ); ?>, setup;
|
||||
|
||||
if ( ! options )
|
||||
return;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1021,7 +1021,7 @@ class WP_List_Table {
|
||||
* @param string $which The location of the pagination: Either 'top' or 'bottom'.
|
||||
*/
|
||||
protected function pagination( $which ) {
|
||||
if ( empty( $this->_pagination_args ) ) {
|
||||
if ( empty( $this->_pagination_args['total_items'] ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1524,15 +1524,12 @@ class WP_List_Table {
|
||||
);
|
||||
}
|
||||
|
||||
$tag = ( 'cb' === $column_key ) ? 'td' : 'th';
|
||||
$scope = ( 'th' === $tag ) ? 'scope="col"' : '';
|
||||
$id = $with_id ? "id='$column_key'" : '';
|
||||
$tag = ( 'cb' === $column_key ) ? 'td' : 'th';
|
||||
$scope = ( 'th' === $tag ) ? 'scope="col"' : '';
|
||||
$id = $with_id ? "id='$column_key'" : '';
|
||||
$class_attr = "class='" . implode( ' ', $class ) . "'";
|
||||
|
||||
if ( ! empty( $class ) ) {
|
||||
$class = "class='" . implode( ' ', $class ) . "'";
|
||||
}
|
||||
|
||||
echo "<$tag $scope $id $class $aria_sort_attr $abbr_attr>$column_display_name</$tag>";
|
||||
echo "<$tag $scope $id $class_attr $aria_sort_attr $abbr_attr>$column_display_name</$tag>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1543,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();
|
||||
@@ -1672,6 +1668,9 @@ class WP_List_Table {
|
||||
* @param string $which The location of the navigation: Either 'top' or 'bottom'.
|
||||
*/
|
||||
protected function display_tablenav( $which ) {
|
||||
if ( 'bottom' === $which && ! $this->has_items() ) {
|
||||
return;
|
||||
}
|
||||
if ( 'top' === $which ) {
|
||||
wp_nonce_field( 'bulk-' . $this->_args['plural'] );
|
||||
}
|
||||
@@ -1872,6 +1871,6 @@ class WP_List_Table {
|
||||
),
|
||||
);
|
||||
|
||||
printf( "<script type='text/javascript'>list_args = %s;</script>\n", wp_json_encode( $args ) );
|
||||
printf( "<script type='text/javascript'>list_args = %s;</script>\n", wp_json_encode( $args, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -36,7 +36,6 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
|
||||
* installed plugins.
|
||||
*
|
||||
* @since 4.9.0
|
||||
* @access protected
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@@ -340,6 +339,12 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
|
||||
$views = apply_filters( "views_{$this->screen->id}", $views );
|
||||
|
||||
$this->screen->render_screen_reader_content( 'heading_views' );
|
||||
|
||||
printf(
|
||||
/* translators: %s: https://wordpress.org/plugins/ */
|
||||
'<p>' . __( 'Plugins extend and expand the functionality of WordPress. You may install plugins from the <a href="%s">WordPress Plugin Directory</a> right on this page, or upload a plugin in .zip format by clicking the button above.' ) . '</p>',
|
||||
__( 'https://wordpress.org/plugins/' )
|
||||
);
|
||||
?>
|
||||
<div class="wp-filter">
|
||||
<ul class="filter-links">
|
||||
|
||||
@@ -807,7 +807,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
if ( $is_active ) {
|
||||
if ( current_user_can( 'manage_network_plugins' ) ) {
|
||||
if ( $has_active_dependents ) {
|
||||
$actions['deactivate'] = __( 'Deactivate' ) .
|
||||
$actions['deactivate'] = __( 'Network Deactivate' ) .
|
||||
'<span class="screen-reader-text">' .
|
||||
__( 'You cannot deactivate this plugin as other plugins require it.' ) .
|
||||
'</span>';
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
@@ -1987,20 +1986,42 @@ class WP_Posts_List_Table extends WP_List_Table {
|
||||
<label class="inline-edit-status alignleft">
|
||||
<span class="title"><?php _e( 'Status' ); ?></span>
|
||||
<select name="_status">
|
||||
<?php if ( $bulk ) : ?>
|
||||
<option value="-1"><?php _e( '— No Change —' ); ?></option>
|
||||
<?php endif; // $bulk ?>
|
||||
<?php
|
||||
$inline_edit_statuses = array();
|
||||
if ( $bulk ) {
|
||||
$inline_edit_statuses['-1'] = __( '— No Change —' );
|
||||
}
|
||||
// Contributors only get "Unpublished" and "Pending Review".
|
||||
if ( $can_publish ) {
|
||||
$inline_edit_statuses['publish'] = __( 'Published' );
|
||||
$inline_edit_statuses['future'] = __( 'Scheduled' );
|
||||
// There is already a checkbox for Private in Single Post Quick Edit. See #63612.
|
||||
if ( $bulk ) {
|
||||
$inline_edit_statuses['private'] = __( 'Private' );
|
||||
}
|
||||
}
|
||||
|
||||
<?php if ( $can_publish ) : // Contributors only get "Unpublished" and "Pending Review". ?>
|
||||
<option value="publish"><?php _e( 'Published' ); ?></option>
|
||||
<option value="future"><?php _e( 'Scheduled' ); ?></option>
|
||||
<?php if ( $bulk ) : ?>
|
||||
<option value="private"><?php _e( 'Private' ); ?></option>
|
||||
<?php endif; // $bulk ?>
|
||||
<?php endif; ?>
|
||||
$inline_edit_statuses['pending'] = __( 'Pending Review' );
|
||||
$inline_edit_statuses['draft'] = __( 'Draft' );
|
||||
|
||||
<option value="pending"><?php _e( 'Pending Review' ); ?></option>
|
||||
<option value="draft"><?php _e( 'Draft' ); ?></option>
|
||||
/**
|
||||
* Filters the statuses available in the Quick Edit and Bulk Edit UI.
|
||||
*
|
||||
* @since 6.9.0
|
||||
*
|
||||
* @param array<string,string> $inline_edit_statuses An array of statuses available in the Quick Edit UI.
|
||||
* @param string $post_type The post type slug.
|
||||
* @param bool $bulk A flag to denote if it's a bulk action.
|
||||
* @param bool $can_publish A flag to denote if the user can publish posts.
|
||||
*/
|
||||
$inline_edit_statuses = apply_filters( 'quick_edit_statuses', $inline_edit_statuses, $screen->post_type, $bulk, $can_publish );
|
||||
|
||||
foreach ( $inline_edit_statuses as $inline_status_value => $inline_status_text ) :
|
||||
?>
|
||||
<option value="<?php echo esc_attr( $inline_status_value ); ?>"><?php echo esc_attr( $inline_status_text ); ?></option>
|
||||
<?php
|
||||
endforeach;
|
||||
?>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
|
||||
@@ -348,7 +348,7 @@ final class WP_Privacy_Policy_Content {
|
||||
sprintf(
|
||||
'wp.data.dispatch( "core/notices" ).createWarningNotice( "%s", { actions: [ %s ], isDismissible: false } )',
|
||||
$message,
|
||||
wp_json_encode( $action )
|
||||
wp_json_encode( $action, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES )
|
||||
),
|
||||
'after'
|
||||
);
|
||||
|
||||
@@ -461,7 +461,7 @@ abstract class WP_Privacy_Requests_Table extends WP_List_Table {
|
||||
echo esc_html( $status_object->label );
|
||||
|
||||
if ( $timestamp ) {
|
||||
echo ' (' . $this->get_timestamp_as_date( $timestamp ) . ')';
|
||||
echo '<span class="status-date">' . $this->get_timestamp_as_date( $timestamp ) . '</span>';
|
||||
}
|
||||
|
||||
echo '</span>';
|
||||
@@ -487,7 +487,14 @@ abstract class WP_Privacy_Requests_Table extends WP_List_Table {
|
||||
return sprintf( __( '%s ago' ), human_time_diff( $timestamp ) );
|
||||
}
|
||||
|
||||
return date_i18n( get_option( 'date_format' ), $timestamp );
|
||||
return sprintf(
|
||||
/* translators: 1: privacy request date format, 2: privacy request time format. */
|
||||
__( '%1$s at %2$s' ),
|
||||
/* translators: privacy request date format. See https://www.php.net/manual/en/datetime.format.php */
|
||||
date_i18n( __( 'Y/m/d' ), $timestamp ),
|
||||
/* translators: privacy request time format. See https://www.php.net/manual/en/datetime.format.php */
|
||||
date_i18n( __( 'g:i a' ), $timestamp )
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -984,6 +984,8 @@ final class WP_Screen {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 3.3.0
|
||||
*
|
||||
* @global array $wp_meta_boxes Global meta box state.
|
||||
*
|
||||
* @return bool
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -728,8 +728,8 @@ class WP_Site_Health {
|
||||
|
||||
$result = array(
|
||||
'label' => sprintf(
|
||||
/* translators: %s: The recommended PHP version. */
|
||||
__( 'Your site is running a recommended version of PHP (%s)' ),
|
||||
/* translators: %s: The server PHP version. */
|
||||
__( 'Your site is running PHP %s' ),
|
||||
PHP_VERSION
|
||||
),
|
||||
'status' => 'good',
|
||||
@@ -739,11 +739,7 @@ class WP_Site_Health {
|
||||
),
|
||||
'description' => sprintf(
|
||||
'<p>%s</p>',
|
||||
sprintf(
|
||||
/* translators: %s: The minimum recommended PHP version. */
|
||||
__( 'PHP is one of the programming languages used to build WordPress. Newer versions of PHP receive regular security updates and may increase your site’s performance. The minimum recommended version of PHP is %s.' ),
|
||||
$response ? $response['recommended_version'] : ''
|
||||
)
|
||||
__( 'PHP is one of the programming languages used to build WordPress. Newer versions of PHP receive regular security updates and may increase your site’s performance.' )
|
||||
),
|
||||
'actions' => sprintf(
|
||||
'<p><a href="%s" target="_blank">%s<span class="screen-reader-text"> %s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
|
||||
@@ -755,8 +751,36 @@ class WP_Site_Health {
|
||||
'test' => 'php_version',
|
||||
);
|
||||
|
||||
if ( ! $response ) {
|
||||
$result['label'] = sprintf(
|
||||
/* translators: %s: The server PHP version. */
|
||||
__( 'Unable to determine the status of the current PHP version (%s)' ),
|
||||
PHP_VERSION
|
||||
);
|
||||
$result['status'] = 'recommended';
|
||||
$result['description'] = '<p><em>' . sprintf(
|
||||
/* translators: %s is the URL to the Serve Happy docs page. */
|
||||
__( 'Unable to access the WordPress.org API for <a href="%s">Serve Happy</a>.' ),
|
||||
'https://codex.wordpress.org/WordPress.org_API#Serve_Happy'
|
||||
) . '</em></p>' . $result['description'];
|
||||
return $result;
|
||||
}
|
||||
|
||||
$result['description'] .= '<p>' . sprintf(
|
||||
/* translators: %s: The minimum recommended PHP version. */
|
||||
__( 'The minimum recommended version of PHP is %s.' ),
|
||||
$response['recommended_version']
|
||||
) . '</p>';
|
||||
|
||||
// PHP is up to date.
|
||||
if ( ! $response || version_compare( PHP_VERSION, $response['recommended_version'], '>=' ) ) {
|
||||
if ( version_compare( PHP_VERSION, $response['recommended_version'], '>=' ) ) {
|
||||
$result['label'] = sprintf(
|
||||
/* translators: %s: The server PHP version. */
|
||||
__( 'Your site is running a recommended version of PHP (%s)' ),
|
||||
PHP_VERSION
|
||||
);
|
||||
$result['status'] = 'good';
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -1076,7 +1100,7 @@ class WP_Site_Health {
|
||||
$result['status'] = 'recommended';
|
||||
}
|
||||
|
||||
$failures[ $library ] = "<span class='dashicons $class'><span class='screen-reader-text'>$screen_reader</span></span> $message";
|
||||
$failures[ $library ] = "<span class='dashicons $class' aria-hidden='true'></span><span class='screen-reader-text'>$screen_reader</span> $message";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2440,19 +2464,19 @@ class WP_Site_Health {
|
||||
$page_cache_test_summary = array();
|
||||
|
||||
if ( empty( $page_cache_detail['response_time'] ) ) {
|
||||
$page_cache_test_summary[] = '<span class="dashicons dashicons-dismiss"></span> ' . __( 'Server response time could not be determined. Verify that loopback requests are working.' );
|
||||
$page_cache_test_summary[] = '<span class="dashicons dashicons-dismiss" aria-hidden="true"></span> ' . __( 'Server response time could not be determined. Verify that loopback requests are working.' );
|
||||
} else {
|
||||
|
||||
$threshold = $this->get_good_response_time_threshold();
|
||||
if ( $page_cache_detail['response_time'] < $threshold ) {
|
||||
$page_cache_test_summary[] = '<span class="dashicons dashicons-yes-alt"></span> ' . sprintf(
|
||||
$page_cache_test_summary[] = '<span class="dashicons dashicons-yes-alt" aria-hidden="true"></span> ' . sprintf(
|
||||
/* translators: 1: The response time in milliseconds, 2: The recommended threshold in milliseconds. */
|
||||
__( 'Median server response time was %1$s milliseconds. This is less than the recommended %2$s milliseconds threshold.' ),
|
||||
number_format_i18n( $page_cache_detail['response_time'] ),
|
||||
number_format_i18n( $threshold )
|
||||
);
|
||||
} else {
|
||||
$page_cache_test_summary[] = '<span class="dashicons dashicons-warning"></span> ' . sprintf(
|
||||
$page_cache_test_summary[] = '<span class="dashicons dashicons-warning" aria-hidden="true"></span> ' . sprintf(
|
||||
/* translators: 1: The response time in milliseconds, 2: The recommended threshold in milliseconds. */
|
||||
__( 'Median server response time was %1$s milliseconds. It should be less than the recommended %2$s milliseconds threshold.' ),
|
||||
number_format_i18n( $page_cache_detail['response_time'] ),
|
||||
@@ -2461,9 +2485,9 @@ class WP_Site_Health {
|
||||
}
|
||||
|
||||
if ( empty( $page_cache_detail['headers'] ) ) {
|
||||
$page_cache_test_summary[] = '<span class="dashicons dashicons-warning"></span> ' . __( 'No client caching response headers were detected.' );
|
||||
$page_cache_test_summary[] = '<span class="dashicons dashicons-warning" aria-hidden="true"></span> ' . __( 'No client caching response headers were detected.' );
|
||||
} else {
|
||||
$headers_summary = '<span class="dashicons dashicons-yes-alt"></span>';
|
||||
$headers_summary = '<span class="dashicons dashicons-yes-alt" aria-hidden="true"></span>';
|
||||
$headers_summary .= ' ' . sprintf(
|
||||
/* translators: %d: Number of caching headers. */
|
||||
_n(
|
||||
@@ -2479,10 +2503,10 @@ class WP_Site_Health {
|
||||
}
|
||||
|
||||
if ( $page_cache_detail['advanced_cache_present'] ) {
|
||||
$page_cache_test_summary[] = '<span class="dashicons dashicons-yes-alt"></span> ' . __( 'A page cache plugin was detected.' );
|
||||
$page_cache_test_summary[] = '<span class="dashicons dashicons-yes-alt" aria-hidden="true"></span> ' . __( 'A page cache plugin was detected.' );
|
||||
} elseif ( ! ( is_array( $page_cache_detail ) && ! empty( $page_cache_detail['headers'] ) ) ) {
|
||||
// Note: This message is not shown if client caching response headers were present since an external caching layer may be employed.
|
||||
$page_cache_test_summary[] = '<span class="dashicons dashicons-warning"></span> ' . __( 'A page cache plugin was not detected.' );
|
||||
$page_cache_test_summary[] = '<span class="dashicons dashicons-warning" aria-hidden="true"></span> ' . __( 'A page cache plugin was not detected.' );
|
||||
}
|
||||
|
||||
$result['description'] .= '<ul><li>' . implode( '</li><li>', $page_cache_test_summary ) . '</li></ul>';
|
||||
@@ -2687,6 +2711,49 @@ class WP_Site_Health {
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests whether search engine indexing is enabled.
|
||||
*
|
||||
* Surfaces as “good” if `blog_public === 1`, or “recommended” if `blog_public === 0`.
|
||||
*
|
||||
* @since 6.9.0
|
||||
*
|
||||
* @return array The test results.
|
||||
*/
|
||||
public function get_test_search_engine_visibility() {
|
||||
$result = array(
|
||||
'label' => __( 'Search engine indexing is enabled.', 'default' ),
|
||||
'status' => 'good',
|
||||
'badge' => array(
|
||||
'label' => __( 'Privacy', 'default' ),
|
||||
'color' => 'blue',
|
||||
),
|
||||
'description' => sprintf(
|
||||
'<p>%s</p>',
|
||||
__( 'Search engines can crawl and index your site. No action needed.', 'default' )
|
||||
),
|
||||
'actions' => sprintf(
|
||||
'<p><a href="%1$s">%2$s</a></p>',
|
||||
esc_url( admin_url( 'options-reading.php#blog_public' ) ),
|
||||
__( 'Review your visibility settings', 'default' )
|
||||
),
|
||||
'test' => 'search_engine_visibility',
|
||||
);
|
||||
|
||||
// If indexing is discouraged, flip to “recommended”:
|
||||
if ( ! get_option( 'blog_public' ) ) {
|
||||
$result['status'] = 'recommended';
|
||||
$result['label'] = __( 'Search engines are discouraged from indexing this site.', 'default' );
|
||||
$result['badge']['color'] = 'blue';
|
||||
$result['description'] = sprintf(
|
||||
'<p>%s</p>',
|
||||
__( 'Your site is hidden from search engines. Consider enabling indexing if this is a public site.', 'default' )
|
||||
);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a set of tests that belong to the site status page.
|
||||
*
|
||||
@@ -2775,6 +2842,10 @@ class WP_Site_Health {
|
||||
'label' => __( 'Autoloaded options' ),
|
||||
'test' => 'autoloaded_options',
|
||||
),
|
||||
'search_engine_visibility' => array(
|
||||
'label' => __( 'Search Engine Visibility' ),
|
||||
'test' => 'search_engine_visibility',
|
||||
),
|
||||
),
|
||||
'async' => array(
|
||||
'dotorg_communication' => array(
|
||||
@@ -3494,9 +3565,9 @@ class WP_Site_Health {
|
||||
*
|
||||
* The default is based on https://web.dev/time-to-first-byte/.
|
||||
*
|
||||
* @param int $threshold Threshold in milliseconds. Default 600.
|
||||
*
|
||||
* @since 6.1.0
|
||||
*
|
||||
* @param int $threshold Threshold in milliseconds. Default 600.
|
||||
*/
|
||||
return (int) apply_filters( 'site_status_good_response_time_threshold', 600 );
|
||||
}
|
||||
|
||||
@@ -27,10 +27,10 @@ class WP_Terms_List_Table extends WP_List_Table {
|
||||
*
|
||||
* @see WP_List_Table::__construct() for more information on default arguments.
|
||||
*
|
||||
* @global string $post_type Global post type.
|
||||
* @global string $taxonomy Global taxonomy.
|
||||
* @global string $action
|
||||
* @global object $tax
|
||||
* @global string $post_type Global post type.
|
||||
* @global string $taxonomy Global taxonomy.
|
||||
* @global string $action
|
||||
* @global WP_Taxonomy $tax Global taxonomy object.
|
||||
*
|
||||
* @param array $args An associative array of arguments.
|
||||
*/
|
||||
|
||||
@@ -357,7 +357,7 @@ class WP_Themes_List_Table extends WP_List_Table {
|
||||
$args = array_merge( $args, $extra_args );
|
||||
}
|
||||
|
||||
printf( "<script type='text/javascript'>var theme_list_args = %s;</script>\n", wp_json_encode( $args ) );
|
||||
printf( "<script type='text/javascript'>var theme_list_args = %s;</script>\n", wp_json_encode( $args, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) );
|
||||
parent::_js_vars();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,6 +138,7 @@ function get_comment_to_edit( $id ) {
|
||||
* Gets the number of pending comments on a post or posts.
|
||||
*
|
||||
* @since 2.3.0
|
||||
* @since 6.9.0 Exclude the 'note' comment type from the count.
|
||||
*
|
||||
* @global wpdb $wpdb WordPress database abstraction object.
|
||||
*
|
||||
@@ -157,7 +158,7 @@ function get_pending_comments_num( $post_id ) {
|
||||
$post_id_array = array_map( 'intval', $post_id_array );
|
||||
$post_id_in = "'" . implode( "', '", $post_id_array ) . "'";
|
||||
|
||||
$pending = $wpdb->get_results( "SELECT comment_post_ID, COUNT(comment_ID) as num_comments FROM $wpdb->comments WHERE comment_post_ID IN ( $post_id_in ) AND comment_approved = '0' GROUP BY comment_post_ID", ARRAY_A );
|
||||
$pending = $wpdb->get_results( "SELECT comment_post_ID, COUNT(comment_ID) as num_comments FROM $wpdb->comments WHERE comment_post_ID IN ( $post_id_in ) AND comment_approved = '0' AND comment_type != 'note' GROUP BY comment_post_ID", ARRAY_A );
|
||||
|
||||
if ( $single ) {
|
||||
if ( empty( $pending ) ) {
|
||||
@@ -210,6 +211,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 ) {
|
||||
|
||||
@@ -1074,8 +1074,11 @@ function wp_dashboard_recent_comments( $total_items = 5 ) {
|
||||
$comments_query['status'] = 'approve';
|
||||
}
|
||||
|
||||
while ( count( $comments ) < $total_items && $possible = get_comments( $comments_query ) ) {
|
||||
if ( ! is_array( $possible ) ) {
|
||||
$comments_count = 0;
|
||||
do {
|
||||
$possible = get_comments( $comments_query );
|
||||
|
||||
if ( empty( $possible ) || ! is_array( $possible ) ) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1088,16 +1091,17 @@ function wp_dashboard_recent_comments( $total_items = 5 ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$comments[] = $comment;
|
||||
$comments[] = $comment;
|
||||
$comments_count = count( $comments );
|
||||
|
||||
if ( count( $comments ) === $total_items ) {
|
||||
if ( $comments_count === $total_items ) {
|
||||
break 2;
|
||||
}
|
||||
}
|
||||
|
||||
$comments_query['offset'] += $comments_query['number'];
|
||||
$comments_query['number'] = $total_items * 10;
|
||||
}
|
||||
} while ( $comments_count < $total_items );
|
||||
|
||||
if ( $comments ) {
|
||||
echo '<div id="latest-comments" class="activity-block table-view-list">';
|
||||
@@ -1457,7 +1461,7 @@ function wp_print_community_events_templates() {
|
||||
);
|
||||
#>
|
||||
{{ 'wordcamp' === event.type ? 'WordCamp' : titleCaseEventType }}
|
||||
<span class="ce-separator"></span>
|
||||
<span class="ce-separator" aria-hidden="true"></span>
|
||||
<# } #>
|
||||
<span class="event-city">{{ event.location.location }}</span>
|
||||
</div>
|
||||
|
||||
@@ -53,7 +53,7 @@ function wp_shrink_dimensions( $width, $height, $wmax = 128, $hmax = 96 ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculated the new dimensions for a downsampled image.
|
||||
* Calculates the new dimensions for a downsampled image.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @deprecated 3.5.0 Use wp_constrain_dimensions()
|
||||
|
||||
@@ -243,7 +243,7 @@ function export_wp( $args = array() ) {
|
||||
* @return string
|
||||
*/
|
||||
function wxr_cdata( $str ) {
|
||||
if ( ! seems_utf8( $str ) ) {
|
||||
if ( ! wp_is_valid_utf8( $str ) ) {
|
||||
$str = utf8_encode( $str );
|
||||
}
|
||||
// $str = ent2ncr(esc_html($str));
|
||||
@@ -405,19 +405,26 @@ function export_wp( $args = array() ) {
|
||||
global $wpdb;
|
||||
|
||||
if ( ! empty( $post_ids ) ) {
|
||||
$post_ids = array_map( 'absint', $post_ids );
|
||||
$and = 'AND ID IN ( ' . implode( ', ', $post_ids ) . ')';
|
||||
$post_ids = array_map( 'absint', $post_ids );
|
||||
$post_id_chunks = array_chunk( $post_ids, 20 );
|
||||
} else {
|
||||
$and = '';
|
||||
$post_id_chunks = array( array() );
|
||||
}
|
||||
|
||||
$authors = array();
|
||||
$results = $wpdb->get_results( "SELECT DISTINCT post_author FROM $wpdb->posts WHERE post_status != 'auto-draft' $and" );
|
||||
foreach ( (array) $results as $result ) {
|
||||
$authors[] = get_userdata( $result->post_author );
|
||||
|
||||
foreach ( $post_id_chunks as $next_posts ) {
|
||||
$and = ! empty( $next_posts ) ? 'AND ID IN (' . implode( ', ', $next_posts ) . ')' : '';
|
||||
|
||||
$results = $wpdb->get_results( "SELECT DISTINCT post_author FROM $wpdb->posts WHERE post_status != 'auto-draft' $and" );
|
||||
|
||||
foreach ( (array) $results as $result ) {
|
||||
$authors[] = get_userdata( $result->post_author );
|
||||
}
|
||||
}
|
||||
|
||||
$authors = array_filter( $authors );
|
||||
$authors = array_unique( $authors, SORT_REGULAR ); // Remove duplicate authors.
|
||||
|
||||
foreach ( $authors as $author ) {
|
||||
echo "\t<wp:author>";
|
||||
|
||||
@@ -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"';
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -267,7 +267,7 @@ function wp_image_editor( $post_id, $msg = false ) {
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class="imgedit-crop-apply imgedit-menu container">
|
||||
<button class="button-primary" type="button" onclick="imageEdit.handleCropToolClick( <?php echo "$post_id, '$nonce'"; ?>, this );" class="imgedit-crop-apply button"><?php esc_html_e( 'Apply Crop' ); ?></button> <button type="button" onclick="imageEdit.handleCropToolClick( <?php echo "$post_id, '$nonce'"; ?>, this );" class="imgedit-crop-clear button" disabled="disabled"><?php esc_html_e( 'Clear Crop' ); ?></button>
|
||||
<button class="button button-primary" type="button" onclick="imageEdit.handleCropToolClick( <?php echo "$post_id, '$nonce'"; ?>, this );" class="imgedit-crop-apply button"><?php esc_html_e( 'Apply Crop' ); ?></button> <button type="button" onclick="imageEdit.handleCropToolClick( <?php echo "$post_id, '$nonce'"; ?>, this );" class="imgedit-crop-clear button" disabled="disabled"><?php esc_html_e( 'Clear Crop' ); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -545,7 +545,10 @@ function _rotate_image_resource( $img, $angle ) {
|
||||
$rotated = imagerotate( $img, $angle, 0 );
|
||||
|
||||
if ( is_gd_image( $rotated ) ) {
|
||||
imagedestroy( $img );
|
||||
if ( PHP_VERSION_ID < 80000 ) { // imagedestroy() has no effect as of PHP 8.0.
|
||||
imagedestroy( $img );
|
||||
}
|
||||
|
||||
$img = $rotated;
|
||||
}
|
||||
}
|
||||
@@ -580,7 +583,10 @@ function _flip_image_resource( $img, $horz, $vert ) {
|
||||
$sh = $horz ? -$h : $h;
|
||||
|
||||
if ( imagecopyresampled( $dst, $img, 0, 0, $sx, $sy, $w, $h, $sw, $sh ) ) {
|
||||
imagedestroy( $img );
|
||||
if ( PHP_VERSION_ID < 80000 ) { // imagedestroy() has no effect as of PHP 8.0.
|
||||
imagedestroy( $img );
|
||||
}
|
||||
|
||||
$img = $dst;
|
||||
}
|
||||
}
|
||||
@@ -606,7 +612,10 @@ function _crop_image_resource( $img, $x, $y, $w, $h ) {
|
||||
|
||||
if ( is_gd_image( $dst ) ) {
|
||||
if ( imagecopy( $dst, $img, 0, 0, $x, $y, $w, $h ) ) {
|
||||
imagedestroy( $img );
|
||||
if ( PHP_VERSION_ID < 80000 ) { // imagedestroy() has no effect as of PHP 8.0.
|
||||
imagedestroy( $img );
|
||||
}
|
||||
|
||||
$img = $dst;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -827,7 +827,13 @@ function wp_read_image_metadata( $file ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
list( , , $image_type ) = wp_getimagesize( $file );
|
||||
$image_size = wp_getimagesize( $file );
|
||||
|
||||
if ( false === $image_size ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
list( , , $image_type ) = $image_size;
|
||||
|
||||
/*
|
||||
* EXIF contains a bunch of data we'll probably never need formatted in ways
|
||||
@@ -967,7 +973,7 @@ function wp_read_image_metadata( $file ) {
|
||||
}
|
||||
|
||||
// If both user comments and description are present.
|
||||
if ( empty( $meta['caption'] ) && $exif_description && $exif_usercomment ) {
|
||||
if ( empty( $meta['caption'] ) && $exif_usercomment ) {
|
||||
if ( ! empty( $meta['title'] ) && $exif_description === $meta['title'] ) {
|
||||
$caption = $exif_usercomment;
|
||||
} else {
|
||||
@@ -1039,13 +1045,13 @@ function wp_read_image_metadata( $file ) {
|
||||
}
|
||||
|
||||
foreach ( array( 'title', 'caption', 'credit', 'copyright', 'camera', 'iso' ) as $key ) {
|
||||
if ( $meta[ $key ] && ! seems_utf8( $meta[ $key ] ) ) {
|
||||
if ( $meta[ $key ] && ! wp_is_valid_utf8( $meta[ $key ] ) ) {
|
||||
$meta[ $key ] = utf8_encode( $meta[ $key ] );
|
||||
}
|
||||
}
|
||||
|
||||
foreach ( $meta['keywords'] as $key => $keyword ) {
|
||||
if ( ! seems_utf8( $keyword ) ) {
|
||||
if ( ! wp_is_valid_utf8( $keyword ) ) {
|
||||
$meta['keywords'][ $key ] = utf8_encode( $keyword );
|
||||
}
|
||||
}
|
||||
|
||||
+16
-22
@@ -274,7 +274,7 @@ function media_send_to_editor( $html ) {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
var win = window.dialogArguments || opener || parent || top;
|
||||
win.send_to_editor( <?php echo wp_json_encode( $html ); ?> );
|
||||
win.send_to_editor( <?php echo wp_json_encode( $html, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ); ?> );
|
||||
</script>
|
||||
<?php
|
||||
exit;
|
||||
@@ -650,12 +650,12 @@ function media_buttons( $editor_id = 'content' ) {
|
||||
|
||||
wp_enqueue_media( array( 'post' => $post ) );
|
||||
|
||||
$img = '<span class="wp-media-buttons-icon"></span> ';
|
||||
$img = '<span class="wp-media-buttons-icon" aria-hidden="true"></span> ';
|
||||
|
||||
$id_attribute = 1 === $instance ? ' id="insert-media-button"' : '';
|
||||
|
||||
printf(
|
||||
'<button type="button"%s class="button insert-media add_media" data-editor="%s">%s</button>',
|
||||
'<button type="button"%s class="button insert-media add_media" data-editor="%s" aria-haspopup="dialog" aria-controls="wp-media-modal">%s</button>',
|
||||
$id_attribute,
|
||||
esc_attr( $editor_id ),
|
||||
$img . __( 'Add Media' )
|
||||
@@ -2236,7 +2236,7 @@ function media_upload_form( $errors = null ) {
|
||||
|
||||
?>
|
||||
var resize_height = <?php echo $large_size_h; ?>, resize_width = <?php echo $large_size_w; ?>,
|
||||
wpUploaderInit = <?php echo wp_json_encode( $plupload_init ); ?>;
|
||||
wpUploaderInit = <?php echo wp_json_encode( $plupload_init, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ); ?>;
|
||||
</script>
|
||||
|
||||
<div id="plupload-upload-ui" class="hide-if-no-js">
|
||||
@@ -3028,27 +3028,15 @@ function wp_media_insert_url_form( $default_view = 'image' ) {
|
||||
* Displays the multi-file uploader message.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @global int $post_ID
|
||||
*/
|
||||
function media_upload_flash_bypass() {
|
||||
$browser_uploader = admin_url( 'media-new.php?browser-uploader' );
|
||||
|
||||
$post = get_post();
|
||||
if ( $post ) {
|
||||
$browser_uploader .= '&post_id=' . (int) $post->ID;
|
||||
} elseif ( ! empty( $GLOBALS['post_ID'] ) ) {
|
||||
$browser_uploader .= '&post_id=' . (int) $GLOBALS['post_ID'];
|
||||
}
|
||||
|
||||
?>
|
||||
<p class="upload-flash-bypass">
|
||||
<?php
|
||||
printf(
|
||||
/* translators: 1: URL to browser uploader, 2: Additional link attributes. */
|
||||
__( 'You are using the multi-file uploader. Problems? Try the <a href="%1$s" %2$s>browser uploader</a> instead.' ),
|
||||
$browser_uploader,
|
||||
'target="_blank"'
|
||||
/* translators: %s: HTML attributes for button. */
|
||||
__( 'You are using the multi-file uploader. Problems? Try the <button %s>browser uploader</button> instead.' ),
|
||||
'type="button" class="button-link"'
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
@@ -3063,7 +3051,13 @@ function media_upload_flash_bypass() {
|
||||
function media_upload_html_bypass() {
|
||||
?>
|
||||
<p class="upload-html-bypass hide-if-no-js">
|
||||
<?php _e( 'You are using the browser’s built-in file uploader. The WordPress uploader includes multiple file selection and drag and drop capability. <a href="#">Switch to the multi-file uploader</a>.' ); ?>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: HTML attributes for button. */
|
||||
__( 'You are using the browser’s built-in file uploader. The WordPress uploader includes multiple file selection and drag and drop capability. <button %s>Switch to the multi-file uploader</button>.' ),
|
||||
'type="button" class="button-link"'
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
@@ -3337,7 +3331,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 { ?>
|
||||
@@ -3534,7 +3528,7 @@ function wp_add_id3_tag_data( &$metadata, $data ) {
|
||||
if ( ! empty( $data[ $version ]['comments'] ) ) {
|
||||
foreach ( $data[ $version ]['comments'] as $key => $list ) {
|
||||
if ( 'length' !== $key && ! empty( $list ) ) {
|
||||
$metadata[ $key ] = wp_kses_post( reset( $list ) );
|
||||
$metadata[ $key ] = is_array( $list ) ? wp_kses_post_deep( reset( $list ) ) : wp_kses_post( $list );
|
||||
// Fix bug in byte stream analysis.
|
||||
if ( 'terms_of_use' === $key && str_starts_with( $metadata[ $key ], 'yright notice.' ) ) {
|
||||
$metadata[ $key ] = 'Cop' . $metadata[ $key ];
|
||||
|
||||
@@ -1228,12 +1228,7 @@ function link_categories_meta_box( $link ) {
|
||||
function link_target_meta_box( $link ) {
|
||||
|
||||
?>
|
||||
<fieldset><legend class="screen-reader-text"><span>
|
||||
<?php
|
||||
/* translators: Hidden accessibility text. */
|
||||
_e( 'Target' );
|
||||
?>
|
||||
</span></legend>
|
||||
<fieldset><legend class="screen-reader-text"><span><?php _e( 'Target' ); ?></span></legend>
|
||||
<p><label for="link_target_blank" class="selectit">
|
||||
<input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo ( isset( $link->link_target ) && ( '_blank' === $link->link_target ) ? 'checked="checked"' : '' ); ?> />
|
||||
<?php _e( '<code>_blank</code> — new window or tab.' ); ?></label></p>
|
||||
@@ -1321,29 +1316,21 @@ function link_xfn_meta_box( $link ) {
|
||||
<th scope="row"><label for="link_rel"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'rel:' ); ?></label></th>
|
||||
<td><input type="text" name="link_rel" id="link_rel" value="<?php echo ( isset( $link->link_rel ) ? esc_attr( $link->link_rel ) : '' ); ?>" /></td>
|
||||
</tr>
|
||||
<?php $identity_group_title = /* translators: xfn: https://gmpg.org/xfn/ */ __( 'identity' ); ?>
|
||||
<tr>
|
||||
<th scope="row"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'identity' ); ?></th>
|
||||
<th scope="row"><?php echo $identity_group_title; ?></th>
|
||||
<td><fieldset>
|
||||
<legend class="screen-reader-text"><span>
|
||||
<?php
|
||||
/* translators: Hidden accessibility text. xfn: https://gmpg.org/xfn/ */
|
||||
_e( 'identity' );
|
||||
?>
|
||||
</span></legend>
|
||||
<legend class="screen-reader-text"><span><?php echo $identity_group_title; ?></span></legend>
|
||||
<label for="me">
|
||||
<input type="checkbox" name="identity" value="me" id="me" <?php xfn_check( 'identity', 'me' ); ?> />
|
||||
<?php _e( 'another web address of mine' ); ?></label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
<?php $friendship_group_title = /* translators: xfn: https://gmpg.org/xfn/ */ __( 'friendship' ); ?>
|
||||
<tr>
|
||||
<th scope="row"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'friendship' ); ?></th>
|
||||
<th scope="row"><?php echo $friendship_group_title; ?></th>
|
||||
<td><fieldset>
|
||||
<legend class="screen-reader-text"><span>
|
||||
<?php
|
||||
/* translators: Hidden accessibility text. xfn: https://gmpg.org/xfn/ */
|
||||
_e( 'friendship' );
|
||||
?>
|
||||
</span></legend>
|
||||
<legend class="screen-reader-text"><span><?php echo $friendship_group_title; ?></span></legend>
|
||||
<label for="contact">
|
||||
<input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check( 'friendship', 'contact' ); ?> /> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'contact' ); ?>
|
||||
</label>
|
||||
@@ -1358,29 +1345,21 @@ function link_xfn_meta_box( $link ) {
|
||||
</label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
<?php $physical_group_title = /* translators: xfn: https://gmpg.org/xfn/ */ __( 'physical' ); ?>
|
||||
<tr>
|
||||
<th scope="row"> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'physical' ); ?> </th>
|
||||
<th scope="row"> <?php echo $physical_group_title; ?> </th>
|
||||
<td><fieldset>
|
||||
<legend class="screen-reader-text"><span>
|
||||
<?php
|
||||
/* translators: Hidden accessibility text. xfn: https://gmpg.org/xfn/ */
|
||||
_e( 'physical' );
|
||||
?>
|
||||
</span></legend>
|
||||
<legend class="screen-reader-text"><span><?php echo $physical_group_title; ?></span></legend>
|
||||
<label for="met">
|
||||
<input class="valinp" type="checkbox" name="physical" value="met" id="met" <?php xfn_check( 'physical', 'met' ); ?> /> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'met' ); ?>
|
||||
</label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
<?php $professional_group_title = /* translators: xfn: https://gmpg.org/xfn/ */ __( 'professional' ); ?>
|
||||
<tr>
|
||||
<th scope="row"> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'professional' ); ?> </th>
|
||||
<th scope="row"> <?php echo $professional_group_title; ?> </th>
|
||||
<td><fieldset>
|
||||
<legend class="screen-reader-text"><span>
|
||||
<?php
|
||||
/* translators: Hidden accessibility text. xfn: https://gmpg.org/xfn/ */
|
||||
_e( 'professional' );
|
||||
?>
|
||||
</span></legend>
|
||||
<legend class="screen-reader-text"><span><?php echo $professional_group_title; ?></span></legend>
|
||||
<label for="co-worker">
|
||||
<input class="valinp" type="checkbox" name="professional" value="co-worker" id="co-worker" <?php xfn_check( 'professional', 'co-worker' ); ?> /> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'co-worker' ); ?>
|
||||
</label>
|
||||
@@ -1389,15 +1368,11 @@ function link_xfn_meta_box( $link ) {
|
||||
</label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
<?php $geographical_group_title = /* translators: xfn: https://gmpg.org/xfn/ */ __( 'geographical' ); ?>
|
||||
<tr>
|
||||
<th scope="row"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'geographical' ); ?></th>
|
||||
<th scope="row"><?php echo $geographical_group_title; ?></th>
|
||||
<td><fieldset>
|
||||
<legend class="screen-reader-text"><span>
|
||||
<?php
|
||||
/* translators: Hidden accessibility text. xfn: https://gmpg.org/xfn/ */
|
||||
_e( 'geographical' );
|
||||
?>
|
||||
</span></legend>
|
||||
<legend class="screen-reader-text"><span><?php echo $geographical_group_title; ?></span></legend>
|
||||
<label for="co-resident">
|
||||
<input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check( 'geographical', 'co-resident' ); ?> /> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'co-resident' ); ?>
|
||||
</label>
|
||||
@@ -1409,15 +1384,11 @@ function link_xfn_meta_box( $link ) {
|
||||
</label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
<?php $family_group_title = /* translators: xfn: https://gmpg.org/xfn/ */ __( 'family' ); ?>
|
||||
<tr>
|
||||
<th scope="row"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'family' ); ?></th>
|
||||
<th scope="row"><?php echo $family_group_title; ?></th>
|
||||
<td><fieldset>
|
||||
<legend class="screen-reader-text"><span>
|
||||
<?php
|
||||
/* translators: Hidden accessibility text. xfn: https://gmpg.org/xfn/ */
|
||||
_e( 'family' );
|
||||
?>
|
||||
</span></legend>
|
||||
<legend class="screen-reader-text"><span><?php echo $family_group_title; ?></span></legend>
|
||||
<label for="child">
|
||||
<input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check( 'family', 'child' ); ?> /> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'child' ); ?>
|
||||
</label>
|
||||
@@ -1438,15 +1409,11 @@ function link_xfn_meta_box( $link ) {
|
||||
</label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
<?php $romantic_group_title = /* translators: xfn: https://gmpg.org/xfn/ */ __( 'romantic' ); ?>
|
||||
<tr>
|
||||
<th scope="row"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'romantic' ); ?></th>
|
||||
<th scope="row"><?php echo $romantic_group_title; ?></th>
|
||||
<td><fieldset>
|
||||
<legend class="screen-reader-text"><span>
|
||||
<?php
|
||||
/* translators: Hidden accessibility text. xfn: https://gmpg.org/xfn/ */
|
||||
_e( 'romantic' );
|
||||
?>
|
||||
</span></legend>
|
||||
<legend class="screen-reader-text"><span><?php echo $romantic_group_title; ?></span></legend>
|
||||
<label for="muse">
|
||||
<input class="valinp" type="checkbox" name="romantic" value="muse" id="muse" <?php xfn_check( 'romantic', 'muse' ); ?> /> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'muse' ); ?>
|
||||
</label>
|
||||
|
||||
+14
-16
@@ -205,7 +205,7 @@ Any changes to the directives between these markers will be overwritten.'
|
||||
|
||||
if ( ! $found_marker ) {
|
||||
$pre_lines[] = $line;
|
||||
} elseif ( $found_marker && $found_end_marker ) {
|
||||
} elseif ( $found_end_marker ) {
|
||||
$post_lines[] = $line;
|
||||
} else {
|
||||
$existing_lines[] = $line;
|
||||
@@ -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
|
||||
*
|
||||
@@ -1022,12 +1022,7 @@ function admin_color_scheme_picker( $user_id ) {
|
||||
}
|
||||
?>
|
||||
<fieldset id="color-picker" class="scheme-list">
|
||||
<legend class="screen-reader-text"><span>
|
||||
<?php
|
||||
/* translators: Hidden accessibility text. */
|
||||
_e( 'Admin Color Scheme' );
|
||||
?>
|
||||
</span></legend>
|
||||
<legend class="screen-reader-text"><span><?php _e( 'Administration Color Scheme' ); ?></span></legend>
|
||||
<?php
|
||||
wp_nonce_field( 'save-color-scheme', 'color-nonce', false );
|
||||
foreach ( $_wp_admin_css_colors as $color => $color_info ) :
|
||||
@@ -1057,6 +1052,8 @@ function admin_color_scheme_picker( $user_id ) {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @since 3.8.0
|
||||
*
|
||||
* @global array $_wp_admin_css_colors
|
||||
*/
|
||||
@@ -1083,7 +1080,7 @@ function wp_color_scheme_settings() {
|
||||
);
|
||||
}
|
||||
|
||||
echo '<script type="text/javascript">var _wpColorScheme = ' . wp_json_encode( array( 'icons' => $icon_colors ) ) . ";</script>\n";
|
||||
echo '<script type="text/javascript">var _wpColorScheme = ' . wp_json_encode( array( 'icons' => $icon_colors ), JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) . ";</script>\n";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1483,11 +1480,12 @@ All at ###SITENAME###
|
||||
* Filters the text of the email sent when a change of site admin email address is attempted.
|
||||
*
|
||||
* The following strings have a special meaning and will get replaced dynamically:
|
||||
* - ###USERNAME### The current user's username.
|
||||
* - ###ADMIN_URL### The link to click on to confirm the email change.
|
||||
* - ###EMAIL### The proposed new site admin email address.
|
||||
* - ###SITENAME### The name of the site.
|
||||
* - ###SITEURL### The URL to the site.
|
||||
*
|
||||
* - `###USERNAME###` The current user's username.
|
||||
* - `###ADMIN_URL###` The link to click on to confirm the email change.
|
||||
* - `###EMAIL###` The proposed new site admin email address.
|
||||
* - `###SITENAME###` The name of the site.
|
||||
* - `###SITEURL###` The URL to the site.
|
||||
*
|
||||
* @since MU (3.0.0)
|
||||
* @since 4.9.0 This filter is no longer Multisite specific.
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -80,20 +80,37 @@ function _wp_ajax_menu_quick_search( $request = array() ) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ( preg_match( '/quick-search-(posttype|taxonomy)-([a-zA-Z_-]*\b)/', $type, $matches ) ) {
|
||||
} elseif ( preg_match( '/quick-search-(posttype|taxonomy)-([a-zA-Z0-9_-]*\b)/', $type, $matches ) ) {
|
||||
if ( 'posttype' === $matches[1] && get_post_type_object( $matches[2] ) ) {
|
||||
$post_type_obj = _wp_nav_menu_meta_box_object( get_post_type_object( $matches[2] ) );
|
||||
$args = array_merge(
|
||||
$args,
|
||||
array(
|
||||
'no_found_rows' => true,
|
||||
'update_post_meta_cache' => false,
|
||||
'update_post_term_cache' => false,
|
||||
'posts_per_page' => 10,
|
||||
'post_type' => $matches[2],
|
||||
's' => $query,
|
||||
)
|
||||
$query_args = array(
|
||||
'no_found_rows' => true,
|
||||
'update_post_meta_cache' => false,
|
||||
'update_post_term_cache' => false,
|
||||
'posts_per_page' => 10,
|
||||
'post_type' => $matches[2],
|
||||
's' => $query,
|
||||
'search_columns' => array( 'post_title' ),
|
||||
);
|
||||
/**
|
||||
* Filter the menu quick search arguments.
|
||||
*
|
||||
* @since 6.9.0
|
||||
*
|
||||
* @param array $args {
|
||||
* Menu quick search arguments.
|
||||
*
|
||||
* @type boolean $no_found_rows Whether to return found rows data. Default true.
|
||||
* @type boolean $update_post_meta_cache Whether to update post meta cache. Default false.
|
||||
* @type boolean $update_post_term_cache Whether to update post term cache. Default false.
|
||||
* @type int $posts_per_page Number of posts to return. Default 10.
|
||||
* @type string $post_type Type of post to return.
|
||||
* @type string $s Search query.
|
||||
* @type array $search_columns Which post table columns to query.
|
||||
* }
|
||||
*/
|
||||
$query_args = apply_filters( 'wp_ajax_menu_quick_search_args', $query_args );
|
||||
$args = array_merge( $args, $query_args );
|
||||
|
||||
if ( isset( $post_type_obj->_default_query ) ) {
|
||||
$args = array_merge( $args, (array) $post_type_obj->_default_query );
|
||||
@@ -495,7 +512,6 @@ function wp_nav_menu_item_post_type_meta_box( $data_object, $box ) {
|
||||
}
|
||||
}
|
||||
|
||||
// @todo Transient caching of these results with proper invalidation on updating of a post of this type.
|
||||
$get_posts = new WP_Query();
|
||||
$posts = $get_posts->query( $args );
|
||||
|
||||
@@ -1239,7 +1255,8 @@ function _wp_nav_menu_meta_box_object( $data_object = null ) {
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param int $menu_id Optional. The ID of the menu to format. Default 0.
|
||||
* @return string|WP_Error The menu formatted to edit or error object on failure.
|
||||
* @return string|WP_Error|null The menu formatted to edit or error object on failure.
|
||||
* Null if the `$menu_id` parameter is not supplied or the term does not exist.
|
||||
*/
|
||||
function wp_get_nav_menu_to_edit( $menu_id = 0 ) {
|
||||
$menu = wp_get_nav_menu_object( $menu_id );
|
||||
@@ -1321,6 +1338,8 @@ function wp_get_nav_menu_to_edit( $menu_id = 0 ) {
|
||||
} elseif ( is_wp_error( $menu ) ) {
|
||||
return $menu;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
function network_domain_check() {
|
||||
global $wpdb;
|
||||
|
||||
$sql = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $wpdb->site ) );
|
||||
if ( $wpdb->get_var( $sql ) ) {
|
||||
if ( $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $wpdb->site ) ) ) ) {
|
||||
return $wpdb->get_var( "SELECT domain FROM $wpdb->site ORDER BY id ASC LIMIT 1" );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ function options_general_add_js() {
|
||||
jQuery( function($) {
|
||||
var $siteName = $( '#wp-admin-bar-site-name' ).children( 'a' ).first(),
|
||||
$siteIconPreview = $('#site-icon-preview-site-title'),
|
||||
homeURL = ( <?php echo wp_json_encode( get_home_url() ); ?> || '' ).replace( /^(https?:\/\/)?(www\.)?/, '' );
|
||||
homeURL = ( <?php echo wp_json_encode( get_home_url(), JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ); ?> || '' ).replace( /^(https?:\/\/)?(www\.)?/, '' );
|
||||
|
||||
$( '#blogname' ).on( 'input', function() {
|
||||
var title = $.trim( $( this ).val() ) || homeURL;
|
||||
|
||||
@@ -399,11 +399,6 @@ function display_plugins_table() {
|
||||
);
|
||||
break;
|
||||
case 'install_plugins_featured':
|
||||
printf(
|
||||
/* translators: %s: https://wordpress.org/plugins/ */
|
||||
'<p>' . __( 'Plugins extend and expand the functionality of WordPress. You may install plugins in the <a href="%s">WordPress Plugin Directory</a> right from here, or upload a plugin in .zip format by clicking the button at the top of this page.' ) . '</p>',
|
||||
__( 'https://wordpress.org/plugins/' )
|
||||
);
|
||||
break;
|
||||
case 'install_plugins_recommended':
|
||||
echo '<p>' . __( 'These suggestions are based on the plugins you and other users have installed.' ) . '</p>';
|
||||
@@ -414,6 +409,9 @@ function display_plugins_table() {
|
||||
}
|
||||
break;
|
||||
}
|
||||
if ( isset( $_GET['tab'] ) && 'featured' === $_GET['tab'] ) {
|
||||
echo '<br />';
|
||||
}
|
||||
?>
|
||||
<form id="plugin-filter" method="post">
|
||||
<?php $wp_list_table->display(); ?>
|
||||
|
||||
@@ -1253,7 +1253,20 @@ function validate_plugin_requirements( $plugin ) {
|
||||
);
|
||||
}
|
||||
|
||||
return true;
|
||||
/**
|
||||
* Filters the plugin requirement validation response.
|
||||
*
|
||||
* If a plugin fails due to a Core-provided validation (incompatible WP, PHP versions), this
|
||||
* filter will not fire. A WP_Error response will already be returned.
|
||||
*
|
||||
* This filter is intended to add additional validation steps by site administrators.
|
||||
*
|
||||
* @since 6.9.0
|
||||
*
|
||||
* @param bool|WP_Error $met_requirements True if the plugin meets requirements, WP_Error if not.
|
||||
* @param string $plugin Path to the plugin file relative to the plugins directory.
|
||||
*/
|
||||
return apply_filters( 'validate_plugin_requirements', true, $plugin );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -768,13 +768,20 @@ function get_default_post_to_edit( $post_type = 'post', $create_in_db = false )
|
||||
'post_type' => $post_type,
|
||||
'post_status' => 'auto-draft',
|
||||
),
|
||||
false,
|
||||
true,
|
||||
false
|
||||
);
|
||||
$post = get_post( $post_id );
|
||||
|
||||
if ( is_wp_error( $post_id ) ) {
|
||||
wp_die( $post_id->get_error_message() );
|
||||
}
|
||||
|
||||
$post = get_post( $post_id );
|
||||
|
||||
if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) && get_option( 'default_post_format' ) ) {
|
||||
set_post_format( $post, get_option( 'default_post_format' ) );
|
||||
}
|
||||
|
||||
wp_after_insert_post( $post, false, null );
|
||||
|
||||
// Schedule auto-draft cleanup.
|
||||
@@ -2186,7 +2193,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 );
|
||||
|
||||
@@ -2442,7 +2449,7 @@ function the_block_editor_meta_boxes() {
|
||||
* our editor instance.
|
||||
*/
|
||||
$script = 'window._wpLoadBlockEditor.then( function() {
|
||||
wp.data.dispatch( \'core/edit-post\' ).setAvailableMetaBoxesPerLocation( ' . wp_json_encode( $meta_boxes_per_location ) . ' );
|
||||
wp.data.dispatch( \'core/edit-post\' ).setAvailableMetaBoxesPerLocation( ' . wp_json_encode( $meta_boxes_per_location, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) . ' );
|
||||
} );';
|
||||
|
||||
wp_add_inline_script( 'wp-edit-post', $script );
|
||||
|
||||
@@ -613,7 +613,7 @@ function wp_privacy_send_personal_data_export_email( $request_id ) {
|
||||
|
||||
/**
|
||||
* Filters the recipient of the personal data export email notification.
|
||||
* Should be used with great caution to avoid sending the data export link to wrong emails.
|
||||
* Should be used with great caution to avoid sending the data export link to the wrong email.
|
||||
*
|
||||
* @since 5.3.0
|
||||
*
|
||||
@@ -678,10 +678,11 @@ All at ###SITENAME###
|
||||
* Filters the text of the email sent with a personal data export file.
|
||||
*
|
||||
* The following strings have a special meaning and will get replaced dynamically:
|
||||
* ###EXPIRATION### The date when the URL will be automatically deleted.
|
||||
* ###LINK### URL of the personal data export file for the user.
|
||||
* ###SITENAME### The name of the site.
|
||||
* ###SITEURL### The URL to the site.
|
||||
*
|
||||
* - `###EXPIRATION###` The date when the URL will be automatically deleted.
|
||||
* - `###LINK###` URL of the personal data export file for the user.
|
||||
* - `###SITENAME###` The name of the site.
|
||||
* - `###SITEURL###` The URL to the site.
|
||||
*
|
||||
* @since 4.9.6
|
||||
* @since 5.3.0 Introduced the `$email_data` array.
|
||||
|
||||
@@ -249,7 +249,7 @@ function wp_prepare_revisions_for_js( $post, $selected_revision_id, $from = null
|
||||
'title' => get_the_title( $post->ID ),
|
||||
'author' => $authors[ $revision->post_author ],
|
||||
'date' => date_i18n( __( 'M j, Y @ H:i' ), $modified ),
|
||||
'dateShort' => date_i18n( _x( 'j M @ H:i', 'revision date short format' ), $modified ),
|
||||
'dateShort' => date_i18n( _x( 'j M Y @ H:i', 'revision date short format' ), $modified ),
|
||||
/* translators: %s: Human-readable time difference. */
|
||||
'timeAgo' => sprintf( __( '%s ago' ), human_time_diff( $modified_gmt, $now_gmt ) ),
|
||||
'autosave' => $autosave,
|
||||
|
||||
@@ -184,7 +184,8 @@ CREATE TABLE $wpdb->posts (
|
||||
KEY post_name (post_name($max_index_length)),
|
||||
KEY type_status_date (post_type,post_status,post_date,ID),
|
||||
KEY post_parent (post_parent),
|
||||
KEY post_author (post_author)
|
||||
KEY post_author (post_author),
|
||||
KEY type_status_author (post_type,post_status,post_author)
|
||||
) $charset_collate;\n";
|
||||
|
||||
// Single site users table. The multisite flavor of the users table is handled below.
|
||||
@@ -245,8 +246,8 @@ CREATE TABLE $wpdb->posts (
|
||||
|
||||
// Multisite global tables.
|
||||
$ms_global_tables = "CREATE TABLE $wpdb->blogs (
|
||||
blog_id bigint(20) NOT NULL auto_increment,
|
||||
site_id bigint(20) NOT NULL default '0',
|
||||
blog_id bigint(20) unsigned NOT NULL auto_increment,
|
||||
site_id bigint(20) unsigned NOT NULL default '0',
|
||||
domain varchar(200) NOT NULL default '',
|
||||
path varchar(100) NOT NULL default '',
|
||||
registered datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
@@ -263,7 +264,7 @@ CREATE TABLE $wpdb->posts (
|
||||
) $charset_collate;
|
||||
CREATE TABLE $wpdb->blogmeta (
|
||||
meta_id bigint(20) unsigned NOT NULL auto_increment,
|
||||
blog_id bigint(20) NOT NULL default '0',
|
||||
blog_id bigint(20) unsigned NOT NULL default '0',
|
||||
meta_key varchar(255) default NULL,
|
||||
meta_value longtext,
|
||||
PRIMARY KEY (meta_id),
|
||||
@@ -271,24 +272,24 @@ CREATE TABLE $wpdb->blogmeta (
|
||||
KEY blog_id (blog_id)
|
||||
) $charset_collate;
|
||||
CREATE TABLE $wpdb->registration_log (
|
||||
ID bigint(20) NOT NULL auto_increment,
|
||||
ID bigint(20) unsigned NOT NULL auto_increment,
|
||||
email varchar(255) NOT NULL default '',
|
||||
IP varchar(30) NOT NULL default '',
|
||||
blog_id bigint(20) NOT NULL default '0',
|
||||
blog_id bigint(20) unsigned NOT NULL default '0',
|
||||
date_registered datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
PRIMARY KEY (ID),
|
||||
KEY IP (IP)
|
||||
) $charset_collate;
|
||||
CREATE TABLE $wpdb->site (
|
||||
id bigint(20) NOT NULL auto_increment,
|
||||
id bigint(20) unsigned NOT NULL auto_increment,
|
||||
domain varchar(200) NOT NULL default '',
|
||||
path varchar(100) NOT NULL default '',
|
||||
PRIMARY KEY (id),
|
||||
KEY domain (domain(140),path(51))
|
||||
) $charset_collate;
|
||||
CREATE TABLE $wpdb->sitemeta (
|
||||
meta_id bigint(20) NOT NULL auto_increment,
|
||||
site_id bigint(20) NOT NULL default '0',
|
||||
meta_id bigint(20) unsigned NOT NULL auto_increment,
|
||||
site_id bigint(20) unsigned NOT NULL default '0',
|
||||
meta_key varchar(255) default NULL,
|
||||
meta_value longtext,
|
||||
PRIMARY KEY (meta_id),
|
||||
@@ -296,7 +297,7 @@ CREATE TABLE $wpdb->sitemeta (
|
||||
KEY site_id (site_id)
|
||||
) $charset_collate;
|
||||
CREATE TABLE $wpdb->signups (
|
||||
signup_id bigint(20) NOT NULL auto_increment,
|
||||
signup_id bigint(20) unsigned NOT NULL auto_increment,
|
||||
domain varchar(200) NOT NULL default '',
|
||||
path varchar(100) NOT NULL default '',
|
||||
title longtext NOT NULL,
|
||||
@@ -559,6 +560,9 @@ function populate_options( array $options = array() ) {
|
||||
|
||||
// 6.4.0
|
||||
'wp_attachment_pages_enabled' => 0,
|
||||
|
||||
// 6.9.0
|
||||
'wp_notes_notify' => 1,
|
||||
);
|
||||
|
||||
// 3.3.0
|
||||
@@ -713,6 +717,13 @@ function populate_options( array $options = array() ) {
|
||||
* @since 2.0.0
|
||||
*/
|
||||
function populate_roles() {
|
||||
$wp_roles = wp_roles();
|
||||
|
||||
// Disable role updates to the database while populating roles.
|
||||
$original_use_db = $wp_roles->use_db;
|
||||
$wp_roles->use_db = false;
|
||||
|
||||
// Populate roles
|
||||
populate_roles_160();
|
||||
populate_roles_210();
|
||||
populate_roles_230();
|
||||
@@ -721,6 +732,14 @@ function populate_roles() {
|
||||
populate_roles_270();
|
||||
populate_roles_280();
|
||||
populate_roles_300();
|
||||
|
||||
// Save the updated roles to the database.
|
||||
if ( $original_use_db ) {
|
||||
update_option( $wp_roles->role_key, $wp_roles->roles, true );
|
||||
}
|
||||
|
||||
// Restore original value for writing to database.
|
||||
$wp_roles->use_db = $original_use_db;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -988,6 +1007,20 @@ function populate_network( $network_id = 1, $domain = '', $email = '', $site_nam
|
||||
|
||||
$network_id = (int) $network_id;
|
||||
|
||||
/**
|
||||
* Fires before a network is populated.
|
||||
*
|
||||
* @since 6.9.0
|
||||
*
|
||||
* @param int $network_id ID of network to populate.
|
||||
* @param string $domain The domain name for the network.
|
||||
* @param string $email Email address for the network administrator.
|
||||
* @param string $site_name The name of the network.
|
||||
* @param string $path The path to append to the network's domain name.
|
||||
* @param bool $subdomain_install Whether the network is a subdomain installation or a subdirectory installation.
|
||||
*/
|
||||
do_action( 'before_populate_network', $network_id, $domain, $email, $site_name, $path, $subdomain_install );
|
||||
|
||||
$errors = new WP_Error();
|
||||
if ( '' === $domain ) {
|
||||
$errors->add( 'empty_domain', __( 'You must provide a domain name.' ) );
|
||||
@@ -1107,6 +1140,20 @@ function populate_network( $network_id = 1, $domain = '', $email = '', $site_nam
|
||||
|
||||
flush_rewrite_rules();
|
||||
|
||||
/**
|
||||
* Fires after a network is created when converting a single site to multisite.
|
||||
*
|
||||
* @since 6.9.0
|
||||
*
|
||||
* @param int $network_id ID of network created.
|
||||
* @param string $domain The domain name for the network.
|
||||
* @param string $email Email address for the network administrator.
|
||||
* @param string $site_name The name of the network.
|
||||
* @param string $path The path to append to the network's domain name.
|
||||
* @param bool $subdomain_install Whether the network is a subdomain installation or a subdirectory installation.
|
||||
*/
|
||||
do_action( 'after_upgrade_to_multisite', $network_id, $domain, $email, $site_name, $path, $subdomain_install );
|
||||
|
||||
if ( ! $subdomain_install ) {
|
||||
return true;
|
||||
}
|
||||
@@ -1153,6 +1200,20 @@ function populate_network( $network_id = 1, $domain = '', $email = '', $site_nam
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires after a network is fully populated.
|
||||
*
|
||||
* @since 6.9.0
|
||||
*
|
||||
* @param int $network_id ID of network created.
|
||||
* @param string $domain The domain name for the network.
|
||||
* @param string $email Email address for the network administrator.
|
||||
* @param string $site_name The name of the network.
|
||||
* @param string $path The path to append to the network's domain name.
|
||||
* @param bool $subdomain_install Whether the network is a subdomain installation or a subdirectory installation.
|
||||
*/
|
||||
do_action( 'after_populate_network', $network_id, $domain, $email, $site_name, $path, $subdomain_install );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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' );
|
||||
@@ -1754,9 +1751,10 @@ function add_settings_field( $id, $title, $callback, $page, $section = 'default'
|
||||
* to output all the sections and fields that were added to that $page with
|
||||
* add_settings_section() and add_settings_field()
|
||||
*
|
||||
* @since 2.7.0
|
||||
*
|
||||
* @global array $wp_settings_sections Storage array of all settings sections added to admin pages.
|
||||
* @global array $wp_settings_fields Storage array of settings fields and info about their pages/sections.
|
||||
* @since 2.7.0
|
||||
*
|
||||
* @param string $page The slug name of the page whose settings sections you want to output.
|
||||
*/
|
||||
@@ -1803,10 +1801,10 @@ function do_settings_sections( $page ) {
|
||||
* a specific section. Should normally be called by do_settings_sections()
|
||||
* rather than directly.
|
||||
*
|
||||
* @global array $wp_settings_fields Storage array of settings fields and their pages/sections.
|
||||
*
|
||||
* @since 2.7.0
|
||||
*
|
||||
* @global array $wp_settings_fields Storage array of settings fields and their pages/sections.
|
||||
*
|
||||
* @param string $page Slug title of the admin page whose settings fields you want to show.
|
||||
* @param string $section Slug title of the settings section whose fields you want to show.
|
||||
*/
|
||||
@@ -2248,30 +2246,43 @@ function iframe_footer() {
|
||||
* @return string Post states string.
|
||||
*/
|
||||
function _post_states( $post, $display = true ) {
|
||||
$post_states = get_post_states( $post );
|
||||
$post_states_string = '';
|
||||
$post_states = get_post_states( $post );
|
||||
$post_states_html = '';
|
||||
|
||||
if ( ! empty( $post_states ) ) {
|
||||
$state_count = count( $post_states );
|
||||
|
||||
$i = 0;
|
||||
|
||||
$post_states_string .= ' — ';
|
||||
$post_states_html .= ' — ';
|
||||
|
||||
foreach ( $post_states as $state ) {
|
||||
++$i;
|
||||
|
||||
$separator = ( $i < $state_count ) ? ', ' : '';
|
||||
|
||||
$post_states_string .= "<span class='post-state'>{$state}{$separator}</span>";
|
||||
$post_states_html .= "<span class='post-state'>{$state}{$separator}</span>";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters the HTML string of post states.
|
||||
*
|
||||
* @since 6.9.0
|
||||
*
|
||||
* @param string $post_states_html All relevant post states combined into an HTML string for display.
|
||||
* E.g. `— <span class='post-state'>Draft, </span><span class='post-state'>Sticky</span>`.
|
||||
* @param array<string, string> $post_states A mapping of post state slugs to translated post state labels.
|
||||
* E.g. `array( 'draft' => __( 'Draft' ), 'sticky' => __( 'Sticky' ), ... )`.
|
||||
* @param WP_Post $post The current post object.
|
||||
*/
|
||||
$post_states_html = apply_filters( 'post_states_html', $post_states_html, $post_states, $post );
|
||||
|
||||
if ( $display ) {
|
||||
echo $post_states_string;
|
||||
echo $post_states_html;
|
||||
}
|
||||
|
||||
return $post_states_string;
|
||||
return $post_states_html;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2344,8 +2355,9 @@ function get_post_states( $post ) {
|
||||
* are used within the filter, their existence should be checked
|
||||
* with `function_exists()` before being used.
|
||||
*
|
||||
* @param string[] $post_states An array of post display states.
|
||||
* @param WP_Post $post The current post object.
|
||||
* @param array<string, string> $post_states A mapping of post state slugs to translated post state labels.
|
||||
* E.g. `array( 'draft' => __( 'Draft' ), 'sticky' => __( 'Sticky' ), ... )`.
|
||||
* @param WP_Post $post The current post object.
|
||||
*/
|
||||
return apply_filters( 'display_post_states', $post_states, $post );
|
||||
}
|
||||
@@ -2482,7 +2494,7 @@ function get_media_states( $post ) {
|
||||
function compression_test() {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
var compressionNonce = <?php echo wp_json_encode( wp_create_nonce( 'update_can_compress_scripts' ) ); ?>;
|
||||
var compressionNonce = <?php echo wp_json_encode( wp_create_nonce( 'update_can_compress_scripts' ), JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ); ?>;
|
||||
var testCompression = {
|
||||
get : function(test) {
|
||||
var x;
|
||||
@@ -2634,6 +2646,8 @@ function get_submit_button( $text = '', $type = 'primary large', $name = 'submit
|
||||
/**
|
||||
* Prints out the beginning of the admin HTML header.
|
||||
*
|
||||
* @since 3.3.0
|
||||
*
|
||||
* @global bool $is_IE
|
||||
*/
|
||||
function _wp_admin_html_begin() {
|
||||
|
||||
@@ -841,6 +841,12 @@ $_old_files = array(
|
||||
'wp-includes/js/dist/undo-manager.min.js',
|
||||
'wp-includes/js/dist/fields.min.js',
|
||||
'wp-includes/js/dist/fields.js',
|
||||
// 6.9
|
||||
'wp-includes/blocks/post-author/editor.css',
|
||||
'wp-includes/blocks/post-author/editor.min.css',
|
||||
'wp-includes/blocks/post-author/editor-rtl.css',
|
||||
'wp-includes/blocks/post-author/editor-rtl.min.css',
|
||||
'wp-includes/SimplePie/src/Decode',
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -1023,6 +1029,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.
|
||||
|
||||
@@ -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() ) {
|
||||
@@ -315,20 +315,20 @@ Commenter avatars come from <a href="%s">Gravatar</a>.'
|
||||
$first_page .= __( "This is an example page. It's different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this:" );
|
||||
$first_page .= "</p>\n<!-- /wp:paragraph -->\n\n";
|
||||
|
||||
$first_page .= "<!-- wp:quote -->\n<blockquote class=\"wp-block-quote\"><p>";
|
||||
$first_page .= "<!-- wp:quote -->\n<blockquote class=\"wp-block-quote\">\n<!-- wp:paragraph -->\n<p>";
|
||||
/* translators: First page content. */
|
||||
$first_page .= __( "Hi there! I'm a bike messenger by day, aspiring actor by night, and this is my website. I live in Los Angeles, have a great dog named Jack, and I like piña coladas. (And gettin' caught in the rain.)" );
|
||||
$first_page .= "</p></blockquote>\n<!-- /wp:quote -->\n\n";
|
||||
$first_page .= "</p>\n<!-- /wp:paragraph -->\n</blockquote>\n<!-- /wp:quote -->\n\n";
|
||||
|
||||
$first_page .= "<!-- wp:paragraph -->\n<p>";
|
||||
/* translators: First page content. */
|
||||
$first_page .= __( '...or something like this:' );
|
||||
$first_page .= "</p>\n<!-- /wp:paragraph -->\n\n";
|
||||
|
||||
$first_page .= "<!-- wp:quote -->\n<blockquote class=\"wp-block-quote\"><p>";
|
||||
$first_page .= "<!-- wp:quote -->\n<blockquote class=\"wp-block-quote\">\n<!-- wp:paragraph -->\n<p>";
|
||||
/* translators: First page content. */
|
||||
$first_page .= __( 'The XYZ Doohickey Company was founded in 1971, and has been providing quality doohickeys to the public ever since. Located in Gotham City, XYZ employs over 2,000 people and does all kinds of awesome things for the Gotham community.' );
|
||||
$first_page .= "</p></blockquote>\n<!-- /wp:quote -->\n\n";
|
||||
$first_page .= "</p>\n<!-- /wp:paragraph -->\n</blockquote>\n<!-- /wp:quote -->\n\n";
|
||||
|
||||
$first_page .= "<!-- wp:paragraph -->\n<p>";
|
||||
$first_page .= sprintf(
|
||||
@@ -2414,6 +2414,7 @@ function upgrade_650() {
|
||||
wp_set_option_autoload_values( $autoload );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes changes made in WordPress 6.7.0.
|
||||
*
|
||||
@@ -2932,8 +2933,10 @@ function dbDelta( $queries = '', $execute = true ) { // phpcs:ignore WordPress.N
|
||||
// Create a tablename index for an array ($cqueries) of recognized query types.
|
||||
foreach ( $queries as $qry ) {
|
||||
if ( preg_match( '|CREATE TABLE ([^ ]*)|', $qry, $matches ) ) {
|
||||
$cqueries[ trim( $matches[1], '`' ) ] = $qry;
|
||||
$for_update[ $matches[1] ] = 'Created table ' . $matches[1];
|
||||
$table_name = trim( $matches[1], '`' );
|
||||
|
||||
$cqueries[ $table_name ] = $qry;
|
||||
$for_update[ $table_name ] = 'Created table ' . $matches[1];
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -3171,7 +3174,7 @@ function dbDelta( $queries = '', $execute = true ) { // phpcs:ignore WordPress.N
|
||||
$fieldtype_base = strtok( $fieldtype_without_parentheses, ' ' );
|
||||
|
||||
// Is actual field type different from the field type in query?
|
||||
if ( $tablefield->Type !== $fieldtype ) {
|
||||
if ( $tablefield->Type !== $fieldtype_lowercased ) {
|
||||
$do_change = true;
|
||||
if ( in_array( $fieldtype_lowercased, $text_fields, true ) && in_array( $tablefield_type_lowercased, $text_fields, true ) ) {
|
||||
if ( array_search( $fieldtype_lowercased, $text_fields, true ) < array_search( $tablefield_type_lowercased, $text_fields, true ) ) {
|
||||
@@ -3250,7 +3253,7 @@ function dbDelta( $queries = '', $execute = true ) { // phpcs:ignore WordPress.N
|
||||
'fieldname' => $tableindex->Column_name,
|
||||
'subpart' => $tableindex->Sub_part,
|
||||
);
|
||||
$index_ary[ $keyname ]['unique'] = ( '0' === $tableindex->Non_unique ) ? true : false;
|
||||
$index_ary[ $keyname ]['unique'] = ( '0' === (string) $tableindex->Non_unique ) ? true : false;
|
||||
$index_ary[ $keyname ]['index_type'] = $tableindex->Index_type;
|
||||
}
|
||||
|
||||
@@ -3711,7 +3714,7 @@ function pre_schema_upgrade() {
|
||||
}
|
||||
|
||||
// Multisite schema upgrades.
|
||||
if ( $wp_current_db_version < 25448 && is_multisite() && wp_should_upgrade_global_tables() ) {
|
||||
if ( $wp_current_db_version < 60497 && is_multisite() && wp_should_upgrade_global_tables() ) {
|
||||
|
||||
// Upgrade versions prior to 3.7.
|
||||
if ( $wp_current_db_version < 25179 ) {
|
||||
@@ -3725,6 +3728,20 @@ function pre_schema_upgrade() {
|
||||
$wpdb->query( "ALTER TABLE $wpdb->blogs CHANGE COLUMN archived archived varchar(1) NOT NULL default '0'" );
|
||||
$wpdb->query( "ALTER TABLE $wpdb->blogs CHANGE COLUMN archived archived tinyint(2) NOT NULL default 0" );
|
||||
}
|
||||
|
||||
// Upgrade versions prior to 6.9
|
||||
if ( $wp_current_db_version < 60497 ) {
|
||||
// Convert ID columns from signed to unsigned
|
||||
$wpdb->query( "ALTER TABLE $wpdb->blogs MODIFY blog_id bigint(20) unsigned NOT NULL auto_increment" );
|
||||
$wpdb->query( "ALTER TABLE $wpdb->blogs MODIFY site_id bigint(20) unsigned NOT NULL default 0" );
|
||||
$wpdb->query( "ALTER TABLE $wpdb->blogmeta MODIFY blog_id bigint(20) unsigned NOT NULL default 0" );
|
||||
$wpdb->query( "ALTER TABLE $wpdb->registration_log MODIFY ID bigint(20) unsigned NOT NULL auto_increment" );
|
||||
$wpdb->query( "ALTER TABLE $wpdb->registration_log MODIFY blog_id bigint(20) unsigned NOT NULL default 0" );
|
||||
$wpdb->query( "ALTER TABLE $wpdb->site MODIFY id bigint(20) unsigned NOT NULL auto_increment" );
|
||||
$wpdb->query( "ALTER TABLE $wpdb->sitemeta MODIFY meta_id bigint(20) unsigned NOT NULL auto_increment" );
|
||||
$wpdb->query( "ALTER TABLE $wpdb->sitemeta MODIFY site_id bigint(20) unsigned NOT NULL default 0" );
|
||||
$wpdb->query( "ALTER TABLE $wpdb->signups MODIFY signup_id bigint(20) unsigned NOT NULL auto_increment" );
|
||||
}
|
||||
}
|
||||
|
||||
// Upgrade versions prior to 4.2.
|
||||
|
||||
Reference in New Issue
Block a user