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
This commit is contained in:
Scott Taylor 2014-05-06 04:57:22 +00:00
parent f95a4c70be
commit a1c6a10489

View File

@ -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 ) :