X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/af50974463450c98503e763a7836a50e260461a9..refs/tags/wordpress-4.2:/wp-admin/includes/misc.php diff --git a/wp-admin/includes/misc.php b/wp-admin/includes/misc.php index 7b710cb0..367611b0 100644 --- a/wp-admin/includes/misc.php +++ b/wp-admin/includes/misc.php @@ -662,7 +662,7 @@ function wp_color_scheme_settings() { $icon_colors = $_wp_admin_css_colors['fresh']->icon_colors; } else { // Fall back to the default set of icon colors if the default scheme is missing. - $icon_colors = array( 'base' => '#999', 'focus' => '#2ea2cc', 'current' => '#fff' ); + $icon_colors = array( 'base' => '#999', 'focus' => '#00a0d2', 'current' => '#fff' ); } echo '\n"; @@ -841,5 +841,49 @@ function post_form_autocomplete_off() { echo ' autocomplete="off"'; } } - add_action( 'post_edit_form_tag', 'post_form_autocomplete_off' ); + +/** + * Remove single-use URL parameters and create canonical link based on new URL. + * + * Remove specific query string parameters from a URL, create the canonical link, + * put it in the admin header, and change the current URL to match. + * + * @since 4.2.0 + */ +function wp_admin_canonical_url() { + $removable_query_args = array( + 'message', 'settings-updated', 'saved', + 'update', 'updated', 'activated', + 'activate', 'deactivate', 'locked', + 'deleted', 'trashed', 'untrashed', + 'enabled', 'disabled', 'skipped', + 'spammed', 'unspammed', + ); + + /** + * Filter the list of URL parameters to remove. + * + * @since 4.2.0 + * + * @param array $removable_query_args An array of parameters to remove from the URL. + */ + $removable_query_args = apply_filters( 'removable_query_args', $removable_query_args ); + + if ( empty( $removable_query_args ) ) { + return; + } + + // Ensure we're using an absolute URL. + $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); + $filtered_url = remove_query_arg( $removable_query_args, $current_url ); + ?> + + +