@@ -346,8 +346,6 @@ public static function redirect_stats_meta_box($post)
346
346
echo '<input type="hidden" id="wp-redirect-hits" name="wp_redirect_hits" value=" ' .((get_post_meta ($ post_id , 'wp_redirect_hits ' , TRUE )) ? esc_attr (get_post_meta ($ post_id , 'wp_redirect_hits ' , TRUE )) : '0 ' ).'" /><br /> ' ."\n" ;
347
347
echo '<div style="display:none;color:red;" id="wp-redirect-hit-count-reset"> ' .__ ('The hit count for this redirect has been reset. To save these changes, click Update. ' , 'wp-redirects ' ).'</div> ' ;
348
348
349
- echo '<input type="hidden" id="wp-redirect-last-access" name="wp_redirect_last_access" value=" ' .((get_post_meta ($ post_id , 'wp_redirect_last_access ' , TRUE )) ? esc_attr (get_post_meta ($ post_id , 'wp_redirect_hits ' , TRUE )) : '0 ' ).'" /><br /> ' ."\n" ;
350
-
351
349
wp_nonce_field ('wp-redirect-meta-boxes ' , 'wp_redirect_meta_boxes ' );
352
350
}
353
351
}
@@ -422,18 +420,31 @@ public static function show_admin_column_value($column, $post_id)
422
420
switch ($ column )
423
421
{
424
422
case 'hits ' :
425
- echo get_post_meta ($ post_id , 'wp_redirect_hits ' , TRUE );
423
+ $ _hits = get_post_meta ($ post_id , 'wp_redirect_hits ' , TRUE );
424
+
425
+ if ($ _hits == '' )
426
+ update_post_meta ($ post_id , 'wp_redirect_hits ' , '0 ' );
427
+
428
+ echo $ _hits ;
429
+
430
+ unset($ _hits );
426
431
break ;
427
432
428
433
case 'last_access ' :
429
- if (get_post_meta ($ post_id , 'wp_redirect_last_access ' , TRUE ) == '0 ' )
434
+ $ _last_access = get_post_meta ($ post_id , 'wp_redirect_last_access ' , TRUE );
435
+
436
+ if ($ _last_access == '' )
430
437
{
431
- echo __ ('Never ' , 'wp-redirects ' );
438
+ update_post_meta ($ post_id , 'wp_redirect_last_access ' , '0 ' );
439
+ $ _last_access = '0 ' ;
432
440
}
433
- elseif (get_post_meta ($ post_id , 'wp_redirect_last_access ' , TRUE ))
434
- {
441
+
442
+ if ($ _last_access == '0 ' )
443
+ echo __ ('Never ' , 'wp-redirects ' );
444
+ else
435
445
echo date (get_option ('date_format ' ), get_post_meta ($ post_id , 'wp_redirect_last_access ' , TRUE ));
436
- }
446
+
447
+ unset($ _last_access );
437
448
break ;
438
449
}
439
450
}
0 commit comments