diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php
index cdac6fde99..d6ce1e84a7 100644
--- a/wp-admin/includes/media.php
+++ b/wp-admin/includes/media.php
@@ -1835,7 +1835,7 @@ function media_upload_library_form($errors) {
$start = ( $_GET['paged'] - 1 ) * 10;
if ( $start < 1 )
$start = 0;
- add_filter( 'post_limits', $limit_filter = create_function( '$a', "return 'LIMIT $start, 10';" ) );
+ add_filter( 'post_limits', create_function( '$a', "return 'LIMIT $start, 10';" ) );
list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query();
diff --git a/wp-admin/includes/ms.php b/wp-admin/includes/ms.php
index 3daf4acf8b..a5691f8484 100644
--- a/wp-admin/includes/ms.php
+++ b/wp-admin/includes/ms.php
@@ -125,7 +125,6 @@ function wpmu_delete_user($id) {
global $wpdb;
$id = (int) $id;
- $user = get_userdata($id);
do_action('wpmu_delete_user', $id);
@@ -767,4 +766,4 @@ function show_post_thumbnail_warning() {
}
add_action( 'admin_notices', 'show_post_thumbnail_warning' );
-?>
+?>
\ No newline at end of file
diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php
index 68e4a59db6..f1b53f1562 100644
--- a/wp-admin/includes/post.php
+++ b/wp-admin/includes/post.php
@@ -960,7 +960,7 @@ function wp_edit_attachments_query( $q = false ) {
function postbox_classes( $id, $page ) {
if ( isset( $_GET['edit'] ) && $_GET['edit'] == $id )
return '';
- $current_user = wp_get_current_user();
+
if ( $closed = get_user_option('closedpostboxes_'.$page ) ) {
if ( !is_array( $closed ) ) {
return '';
diff --git a/wp-admin/includes/schema.php b/wp-admin/includes/schema.php
index 4985b9bd2a..3ed9c920d8 100644
--- a/wp-admin/includes/schema.php
+++ b/wp-admin/includes/schema.php
@@ -623,7 +623,7 @@ function populate_roles_300() {
* @param int $network_id id of network to populate
*/
function populate_network( $network_id = 1, $domain = '', $email = '', $site_name = '', $path = '/', $vhost = 'no' ) {
- global $wpdb, $current_site, $wp_version, $wp_db_version, $wp_rewrite;
+ global $wpdb, $current_site, $wp_db_version, $wp_rewrite;
$msg = '';
//@todo: turn these checks into returned messages
diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php
index d5792cc97a..6710c7e131 100644
--- a/wp-admin/includes/template.php
+++ b/wp-admin/includes/template.php
@@ -2111,7 +2111,7 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true,
if ( 'spam' != $the_comment_status && 'trash' != $the_comment_status ) {
$actions['spam'] = "" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '';
} elseif ( 'spam' == $the_comment_status ) {
- $actions['unspam'] = "" . __( 'Not Spam' ) . '';
+ $actions['unspam'] = "" . __( 'Not Spam' ) . '';
} elseif ( 'trash' == $the_comment_status ) {
$actions['untrash'] = "" . __( 'Restore' ) . '';
}
@@ -2678,13 +2678,12 @@ function the_attachment_links( $id = false ) {
* @param string $default slug for the role that should be already selected
*/
function wp_dropdown_roles( $selected = false ) {
- global $wp_roles;
$p = '';
$r = '';
$editable_roles = get_editable_roles();
- foreach( $editable_roles as $role => $details ) {
+ foreach ( $editable_roles as $role => $details ) {
$name = translate_user_role($details['name'] );
if ( $selected == $role ) // Make default first in list
$p = "\n\t";
@@ -3288,7 +3287,7 @@ function find_posts_div($found_action = '') {
-
+
@@ -3298,7 +3297,7 @@ function find_posts_div($found_action = '') {
-
+
@@ -3544,7 +3543,7 @@ function convert_to_screen( $screen ) {
}
function screen_meta($screen) {
- global $wp_meta_boxes, $_wp_contextual_help, $post_type;
+ global $wp_meta_boxes, $_wp_contextual_help, $title;
if ( is_string($screen) )
$screen = convert_to_screen($screen);
@@ -3607,8 +3606,6 @@ function screen_meta($screen) {
diff --git a/wp-admin/includes/theme-install.php b/wp-admin/includes/theme-install.php
index 91ad8dd2f5..7d5436ec38 100644
--- a/wp-admin/includes/theme-install.php
+++ b/wp-admin/includes/theme-install.php
@@ -366,8 +366,6 @@ function display_theme($theme, $actions = null, $show_details = true) {
* @param int $totalpages Number of pages.
*/
function display_themes($themes, $page = 1, $totalpages = 1) {
- global $themes_allowedtags;
-
$type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : '';
$term = isset($_REQUEST['s']) ? stripslashes( $_REQUEST['s'] ) : '';
?>
diff --git a/wp-admin/includes/theme.php b/wp-admin/includes/theme.php
index de9029d150..d40101c76b 100644
--- a/wp-admin/includes/theme.php
+++ b/wp-admin/includes/theme.php
@@ -87,9 +87,6 @@ function delete_theme($template) {
return new WP_Error('fs_no_themes_dir', __('Unable to locate WordPress theme directory.'));
$themes_dir = trailingslashit( $themes_dir );
-
- $errors = array();
-
$theme_dir = trailingslashit($themes_dir . $template);
$deleted = $wp_filesystem->delete($theme_dir, true);
diff --git a/wp-admin/includes/user.php b/wp-admin/includes/user.php
index 5597bb1a80..55ea2959b2 100644
--- a/wp-admin/includes/user.php
+++ b/wp-admin/includes/user.php
@@ -423,7 +423,6 @@ function wp_delete_user( $id, $reassign = 'novalue' ) {
global $wpdb;
$id = (int) $id;
- $user = new WP_User($id);
// allow for transaction statement
do_action('delete_user', $id);
diff --git a/wp-admin/post.php b/wp-admin/post.php
index bb0ef961d7..e04118d7ca 100644
--- a/wp-admin/post.php
+++ b/wp-admin/post.php
@@ -51,15 +51,6 @@ if ( $post_id ) {
* @param int $post_id Optional. Post ID.
*/
function redirect_post($post_id = '') {
- global $action;
-
- $referredby = '';
- if ( !empty($_POST['referredby']) ) {
- $referredby = preg_replace('|https?://[^/]+|i', '', $_POST['referredby']);
- $referredby = remove_query_arg('_wp_original_http_referer', $referredby);
- }
- $referer = preg_replace('|https?://[^/]+|i', '', wp_get_referer());
-
if ( !empty($_POST['mode']) && 'sidebar' == $_POST['mode'] ) {
if ( isset($_POST['saveasdraft']) )
$location = 'sidebar.php?a=c';
diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php
index 2db63844c6..ff8e1deb8a 100644
--- a/wp-includes/comment-template.php
+++ b/wp-includes/comment-template.php
@@ -971,7 +971,7 @@ function comments_popup_script($width=400, $height=400, $file='') {
* @return null Returns null on single posts and pages.
*/
function comments_popup_link( $zero = false, $one = false, $more = false, $css_class = '', $none = false ) {
- global $id, $wpcommentspopupfile, $wpcommentsjavascript, $post;
+ global $id, $wpcommentspopupfile, $wpcommentsjavascript;
if ( false === $zero ) $zero = __( 'No Comments' );
if ( false === $one ) $one = __( '1 Comment' );
diff --git a/wp-includes/comment.php b/wp-includes/comment.php
index 5529702034..57eb9faa02 100644
--- a/wp-includes/comment.php
+++ b/wp-includes/comment.php
@@ -828,7 +828,7 @@ function wp_count_comments( $post_id = 0 ) {
$total = 0;
$approved = array('0' => 'moderated', '1' => 'approved', 'spam' => 'spam', 'trash' => 'trash', 'post-trashed' => 'post-trashed');
$known_types = array_keys( $approved );
- foreach( (array) $count as $row_num => $row ) {
+ foreach ( (array) $count as $row ) {
// Don't count post-trashed toward totals
if ( 'post-trashed' != $row['comment_approved'] && 'trash' != $row['comment_approved'] )
$total += $row['num_comments'];
diff --git a/wp-includes/functions.php b/wp-includes/functions.php
index 7af1feedab..dd7efc7c6f 100644
--- a/wp-includes/functions.php
+++ b/wp-includes/functions.php
@@ -23,7 +23,6 @@
* @return string Date formated by $dateformatstring or locale (if available).
*/
function mysql2date( $dateformatstring, $mysqlstring, $translate = true ) {
- global $wp_locale;
$m = $mysqlstring;
if ( empty( $m ) )
return false;
diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php
index 1491eaeda7..8d434b2967 100644
--- a/wp-includes/general-template.php
+++ b/wp-includes/general-template.php
@@ -1352,7 +1352,7 @@ function the_date( $d = '', $before = '', $after = '', $echo = true ) {
* @return string|null Null if displaying, string if retrieving.
*/
function get_the_date( $d = '' ) {
- global $post, $day;
+ global $post;
$the_date = '';
if ( '' == $d )
diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php
index 482a48b226..050f34dcc1 100644
--- a/wp-includes/link-template.php
+++ b/wp-includes/link-template.php
@@ -1677,7 +1677,7 @@ function previous_comments_link( $label = '' ) {
* @return string Markup for pagination links.
*/
function paginate_comments_links($args = array()) {
- global $wp_query, $wp_rewrite;
+ global $wp_rewrite;
if ( !is_singular() || !get_option('page_comments') )
return;
diff --git a/wp-includes/ms-blogs.php b/wp-includes/ms-blogs.php
index 58a6579ebb..0fb7e90961 100644
--- a/wp-includes/ms-blogs.php
+++ b/wp-includes/ms-blogs.php
@@ -230,7 +230,7 @@ function update_blog_details( $blog_id, $details = array() ) {
foreach ( array_intersect( array_keys( $details ), $fields ) as $field )
$update_details[$field] = $details[$field];
- $result = $wpdb->update( $wpdb->blogs, $update_details, array('blog_id' => $blog_id) );
+ $wpdb->update( $wpdb->blogs, $update_details, array('blog_id' => $blog_id) );
// If spam status changed, issue actions.
if ( $details[ 'spam' ] != $current_details[ 'spam' ] ) {
diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php
index e130abd587..59c5287882 100644
--- a/wp-includes/ms-functions.php
+++ b/wp-includes/ms-functions.php
@@ -687,8 +687,6 @@ function wpmu_signup_blog_notification($domain, $path, $title, $user, $user_emai
}
function wpmu_signup_user_notification($user, $user_email, $key, $meta = '') {
- global $current_site;
-
if ( !apply_filters('wpmu_signup_user_notification', $user, $user_email, $key, $meta) )
return false;
@@ -781,8 +779,6 @@ function wpmu_create_user( $user_name, $password, $email) {
if ( is_wp_error($user_id) )
return false;
- $user = new WP_User($user_id);
-
// Newly created users have no roles or caps until they are added to a blog.
update_user_option($user_id, 'capabilities', '');
update_user_option($user_id, 'user_level', '');
diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php
index b39662bd3f..eedce13e4d 100644
--- a/wp-includes/pluggable.php
+++ b/wp-includes/pluggable.php
@@ -969,7 +969,6 @@ function wp_notify_postauthor($comment_id, $comment_type='') {
$comment = get_comment($comment_id);
$post = get_post($comment->comment_post_ID);
$user = get_userdata( $post->post_author );
- $current_user = wp_get_current_user();
if ( $comment->user_id == $post->post_author ) return false; // The author moderated a comment on his own post
diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php
index 8e12273034..82c7dd9372 100644
--- a/wp-includes/post-template.php
+++ b/wp-includes/post-template.php
@@ -179,7 +179,7 @@ function the_content($more_link_text = null, $stripteaser = 0) {
* @return string
*/
function get_the_content($more_link_text = null, $stripteaser = 0) {
- global $id, $post, $more, $page, $pages, $multipage, $preview, $pagenow;
+ global $id, $post, $more, $page, $pages, $multipage, $preview;
if ( null === $more_link_text )
$more_link_text = __( '(more...)' );
@@ -367,7 +367,7 @@ function body_class( $class = '' ) {
* @return array Array of classes.
*/
function get_body_class( $class = '' ) {
- global $wp_query, $wpdb, $current_user;
+ global $wp_query, $wpdb;
$classes = array();
diff --git a/wp-includes/post.php b/wp-includes/post.php
index 3866e2c6c4..866100ae14 100644
--- a/wp-includes/post.php
+++ b/wp-includes/post.php
@@ -1429,7 +1429,7 @@ function wp_count_posts( $type = 'post', $perm = '' ) {
foreach ( get_post_stati() as $state )
$stats[$state] = 0;
- foreach ( (array) $count as $row_num => $row )
+ foreach ( (array) $count as $row )
$stats[$row['post_status']] = $row['num_posts'];
$stats = (object) $stats;
diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php
index ab298f4b68..3ac57009fb 100644
--- a/wp-includes/wp-db.php
+++ b/wp-includes/wp-db.php
@@ -869,7 +869,7 @@ class wpdb {
if (!$this->$dbhname ) {
$this->bail("
Error establishing a database connection
-
This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at $dbhost. This could mean your host's database server is down.
+
This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at {$details['db_host']}. This could mean your host's database server is down.
Are you sure you have the correct username and password?
Are you sure that you have typed the correct hostname?