| @@ -48,9 +48,9 @@ | ||
| 48 | 48 | empty( PLL()->curlang ) ? get_calendar() : self::get_calendar(); #modified# |
| 49 | 49 | echo '</div>'; |
| 50 | 50 | echo $args['after_widget']; |
| 51 | 51 | |
| 52 | - self::$pll_instance++; #modified# | |
| 52 | + ++self::$pll_instance; #modified# | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |
| 56 | 56 | * Modified version of the WP get_calendar() function to filter the queries. |
| @@ -57,12 +57,12 @@ | ||
| 57 | 57 | * |
| 58 | 58 | * @since 0.5 |
| 59 | 59 | * |
| 60 | 60 | * @param bool $initial Optional, default is true. Use initial calendar names. |
| 61 | - * @param bool $echo Optional, default is true. Set to false for return. | |
| 62 | - * @return void|string Void if `$echo` argument is true, calendar HTML if `$echo` is false. | |
| 61 | + * @param bool $display Optional, default is true. Set to false for return. | |
| 62 | + * @return void|string Void if `$display` argument is true, calendar HTML if `$display` is false. | |
| 63 | 63 | */ |
| 64 | - static public function get_calendar( $initial = true, $echo = true ) { | |
| 64 | + static public function get_calendar( $initial = true, $display = true ) { | |
| 65 | 65 | global $wpdb, $m, $monthnum, $year, $wp_locale, $posts; |
| 66 | 66 | |
| 67 | 67 | $join_clause = PLL()->model->post->join_clause(); #added# |
| 68 | 68 | $where_clause = PLL()->model->post->where_clause( PLL()->curlang ); #added# |
| @@ -73,9 +73,9 @@ | ||
| 73 | 73 | if ( $cache && is_array( $cache ) && isset( $cache[ $key ] ) ) { |
| 74 | 74 | /** This filter is documented in wp-includes/general-template.php */ |
| 75 | 75 | $output = apply_filters( 'get_calendar', $cache[ $key ] ); |
| 76 | 76 | |
| 77 | - if ( $echo ) { | |
| 77 | + if ( $display ) { | |
| 78 | 78 | echo $output; |
| 79 | 79 | return; |
| 80 | 80 | } |
| 81 | 81 | |
| @@ -132,10 +132,10 @@ | ||
| 132 | 132 | "SELECT MONTH(post_date) AS month, YEAR(post_date) AS year |
| 133 | 133 | FROM $wpdb->posts $join_clause |
| 134 | 134 | WHERE post_date < '$thisyear-$thismonth-01' |
| 135 | 135 | AND post_type = 'post' AND post_status = 'publish' $where_clause |
| 136 | - ORDER BY post_date DESC | |
| 137 | - LIMIT 1" | |
| 136 | + ORDER BY post_date DESC | |
| 137 | + LIMIT 1" | |
| 138 | 138 | ); #modified# |
| 139 | 139 | $next = $wpdb->get_row( |
| 140 | 140 | "SELECT MONTH(post_date) AS month, YEAR(post_date) AS year |
| 141 | 141 | FROM $wpdb->posts $join_clause |
| @@ -140,10 +140,10 @@ | ||
| 140 | 140 | "SELECT MONTH(post_date) AS month, YEAR(post_date) AS year |
| 141 | 141 | FROM $wpdb->posts $join_clause |
| 142 | 142 | WHERE post_date > '$thisyear-$thismonth-{$last_day} 23:59:59' |
| 143 | 143 | AND post_type = 'post' AND post_status = 'publish' $where_clause |
| 144 | - ORDER BY post_date ASC | |
| 145 | - LIMIT 1" | |
| 144 | + ORDER BY post_date ASC | |
| 145 | + LIMIT 1" | |
| 146 | 146 | ); #modified# |
| 147 | 147 | |
| 148 | 148 | /* translators: Calendar caption: 1: Month name, 2: 4-digit year. */ |
| 149 | 149 | $calendar_caption = _x( '%1$s %2$s', 'calendar caption' ); |
| @@ -270,9 +270,9 @@ | ||
| 270 | 270 | |
| 271 | 271 | $cache[ $key ] = $calendar_output; |
| 272 | 272 | wp_cache_set( 'get_calendar', $cache, 'calendar' ); |
| 273 | 273 | |
| 274 | - if ( $echo ) { | |
| 274 | + if ( $display ) { | |
| 275 | 275 | /** This filter is documented in wp-includes/general-template.php */ |
| 276 | 276 | echo apply_filters( 'get_calendar', $calendar_output ); |
| 277 | 277 | return; |
| 278 | 278 | } |