From a1c6a10489eedcfa5a5cf1f692afad93fc1976f4 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Tue, 6 May 2014 04:57:22 +0000 Subject: [PATCH] In `general-template.php` - remove dead code: * In `get_calendar()`, `$cache` is set twice. The first is useless. * In `wp_default_editor()`, `$user` is (accidentally) assigned in a condition. Since it is never used, this is unnecessary. * In `language_attributes()`, `$output` is set twice before it is ever used. The first is unnecessary. * In `paginate_links()`, `$n` is set twice before it is ever used. The first is unnecessary. See #27882. git-svn-id: https://develop.svn.wordpress.org/trunk@28274 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/general-template.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index 514e27e25b..30daba0800 100644 --- a/src/wp-includes/general-template.php +++ b/src/wp-includes/general-template.php @@ -1388,7 +1388,6 @@ function calendar_week_mod($num) { function get_calendar($initial = true, $echo = true) { global $wpdb, $m, $monthnum, $year, $wp_locale, $posts; - $cache = array(); $key = md5( $m . $monthnum . $year ); if ( $cache = wp_cache_get( 'get_calendar', 'calendar' ) ) { if ( is_array($cache) && isset( $cache[ $key ] ) ) { @@ -2244,7 +2243,7 @@ function user_can_richedit() { */ function wp_default_editor() { $r = user_can_richedit() ? 'tinymce' : 'html'; // defaults - if ( $user = wp_get_current_user() ) { // look for cookie + if ( wp_get_current_user() ) { // look for cookie $ed = get_user_setting('editor', 'tinymce'); $r = ( in_array($ed, array('tinymce', 'html', 'test') ) ) ? $ed : $r; } @@ -2345,7 +2344,6 @@ function the_search_query() { */ function language_attributes($doctype = 'html') { $attributes = array(); - $output = ''; if ( function_exists( 'is_rtl' ) && is_rtl() ) $attributes[] = 'dir="rtl"'; @@ -2453,7 +2451,6 @@ function paginate_links( $args = '' ) { $add_args = is_array($add_args) ? $add_args : false; $r = ''; $page_links = array(); - $n = 0; $dots = false; if ( $prev_next && $current && 1 < $current ) :