Variable Cleanup, Unused variables, Typo'd variables, unused code blocks. Fixes #12299

git-svn-id: https://develop.svn.wordpress.org/trunk@13242 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse
2010-02-20 02:01:46 +00:00
parent 8be48fe96a
commit 468d0d7cff
21 changed files with 19 additions and 44 deletions
+1 -1
View File
@@ -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' );
+1 -1
View File
@@ -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'];
-1
View File
@@ -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;
+1 -1
View File
@@ -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 )
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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' ] ) {
-4
View File
@@ -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', '');
-1
View File
@@ -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
+2 -2
View File
@@ -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();
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -869,7 +869,7 @@ class wpdb {
if (!$this->$dbhname ) {
$this->bail("
<h1>Error establishing a database connection</h1>
<p>This either means that the username and password information in your <code>wp-config.php</code> file is incorrect or we can't contact the database server at <code>$dbhost</code>. This could mean your host's database server is down.</p>
<p>This either means that the username and password information in your <code>wp-config.php</code> file is incorrect or we can't contact the database server at <code>{$details['db_host']}</code>. This could mean your host's database server is down.</p>
<ul>
<li>Are you sure you have the correct username and password?</li>
<li>Are you sure that you have typed the correct hostname?</li>