PluginProbe
WebberZone Top 10 — Popular Posts / 4.5.1
WebberZone Top 10 — Popular Posts v4.5.1
4.5.1 4.5.0 4.4.3 4.4.2 4.4.1 4.4.0 4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 trunk 1.0 1.0.1 1.1 1.2 1.3 1.4 1.4.1 1.5 1.5.1 1.5.2 1.5.3 1.6 1.6.1 All 117 releases
← All changes | includes/admin/class-columns.php +16 -3 4.3.24.5.1 View file →
@@ -69,9 +69,9 @@
69 69 if ( ( current_user_can( 'manage_options' ) ) || ( \tptn_get_option( 'show_count_non_admins' ) ) ) {
70 70 if ( \tptn_get_option( 'pv_in_admin' ) ) {
71 71 $cols['tptn_total'] = __( 'Total Views', 'top-10' );
72 72 /* translators: %s: Custom period label (e.g. Daily, Custom (7 days)). */
73 - $cols['tptn_daily'] = sprintf( __( '%s Views', 'top-10' ), Helpers::get_daily_range_label() );
73 + $cols['tptn_daily'] = sprintf( __( '%s Views', 'top-10' ), Helpers::get_daily_range_label( 1 ) );
74 74 $cols['tptn_both'] = __( 'Views', 'top-10' );
75 75 }
76 76 }
77 77 return $cols;
@@ -124,9 +124,14 @@
124 124 * @param int $blog_id Blog ID.
125 125 * @return int
126 126 */
127 127 private static function get_daily_count( $id, $blog_id ) {
128 - return Counter::get_post_count_only( $id, 'daily', $blog_id );
128 + return Counter::get_post_count_only(
129 + $id,
130 + 'daily',
131 + $blog_id,
132 + array( 'from_date' => current_time( 'Y-m-d' ) . ' 00:00:00' )
133 + );
129 134 }
130 135
131 136 /**
132 137 * Format output based on column name.
@@ -193,9 +198,9 @@
193 198 $blog_id = get_current_blog_id();
194 199 $order = ( 'ASC' === strtoupper( (string) $wp_query->get( 'order' ) ) ) ? 'ASC' : 'DESC';
195 200
196 201 if ( $is_daily ) {
197 - $from_date = Helpers::get_from_date();
202 + $from_date = Helpers::get_from_date( current_time( 'Y-m-d' ) . ' 00:00:00', 0, 0 );
198 203 // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Table name is generated internally.
199 204 $clauses['join'] .= $wpdb->prepare(
200 205 " LEFT JOIN {$table_name} AS tptn_counts
201 206 ON {$wpdb->posts}.ID = tptn_counts.postnumber
@@ -223,8 +228,16 @@
223 228 }
224 229
225 230 $clauses['orderby'] = "tptn_visits {$order}";
226 231
232 + /**
233 + * Filters the query clauses used to sort the admin posts list by view count.
234 + *
235 + * @since 3.4.0-RC2
236 + *
237 + * @param array $clauses The query clauses, keyed by clause name.
238 + * @param \WP_Query $wp_query The WP_Query instance.
239 + */
227 240 return apply_filters( 'tptn_posts_clauses', $clauses, $wp_query );
228 241 }
229 242
230 243 /**