Skip to content

Commit 5328bee

Browse files
committed
Remove double call on admin widget
Remove the double counter call on admin widget with a variable.
1 parent 1e039eb commit 5328bee

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

classes/admin/admin-dashboard-widgets.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ public static function widget_render_status() {
4242
wp_cache_flush();
4343
}
4444

45+
/**
46+
* Get counter for the view
47+
*/
48+
$counter = BEA_CSF_Async::get_counter( get_current_blog_id() );
49+
4550
// Include template
4651
include( BEA_CSF_DIR . 'views/admin/blog-widget-status.php' );
4752

views/admin/blog-widget-status.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<div class="main">
22
<p>
3-
<?php printf( esc_html__( 'There are still %d item(s) to synchronize.', 'bea-content-sync-fusion' ), BEA_CSF_Async::get_counter( get_current_blog_id() ) ); ?>
3+
<?php printf( esc_html__( 'There are still %d item(s) to synchronize.', 'bea-content-sync-fusion' ), $counter ); ?>
44
</p>
55

6-
<?php if ( BEA_CSF_Async::get_counter( get_current_blog_id() ) > 0 ) : ?>
6+
<?php if ( $counter > 0 ) : ?>
77
<form method="post">
88
<p class="submit">
99
<?php wp_nonce_field( 'bea-csf-force-refresh' ); ?>

0 commit comments

Comments
 (0)