Skip to content

Commit 970121c

Browse files
authored
Merge pull request #335 from cloudinary/fix/disconnect-count
add notice count when not connected
2 parents cc9c0eb + df03bd9 commit 970121c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

php/class-plugin.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,19 @@ public function setup_settings() {
198198

199199
// Init settings.
200200
\Cloudinary\Settings::init_setting( $this->slug );
201+
202+
// Add count notice if not connected.
203+
if ( ! $this->get_component( 'connect' )->is_connected() ) {
204+
$count = sprintf( ' <span class="update-plugins count-%d"><span class="update-count">%d</span></span>', 1, number_format_i18n( 1 ) );
205+
$main_title = $this->settings->get_param( 'menu_title' ) . $count;
206+
$this->settings->set_param( 'menu_title', $main_title );
207+
$this->settings->set_param( 'connect_count', $count );
208+
209+
// Set the Getting Started title.
210+
$connect = $this->settings->find_setting( 'dashboard' );
211+
$connect_title = $connect->get_param( 'menu_title' ) . $count;
212+
$connect->set_param( 'menu_title', $connect_title );
213+
}
201214
}
202215

203216
/**

0 commit comments

Comments
 (0)