register( 'adpresso-js-rendering-root', __( 'JS Rendering', 'adpresso' ) . ( empty( $reasons ) ? '' : sprintf( ' (%d)', count( $reasons ) ) ), [ 'location' => 'admin_bar', 'context' => null, 'type' => empty( $reasons ) ? 'success' : 'info', ] ); if ( empty( $reasons ) ) { NotificationManager::get()->register( 'adpresso-js-rendering-none', __( 'No global reason found - JS mode (if any) is decided per placement/ad only.', 'adpresso' ), [ 'location' => 'admin_bar', 'context' => 'adpresso-js-rendering-root', 'type' => 'success', ] ); return; } foreach ( $reasons as $key => $label ) { NotificationManager::get()->register( 'adpresso-js-rendering-' . $key, esc_html( $label ), [ 'location' => 'admin_bar', 'context' => 'adpresso-js-rendering-root', 'type' => 'info', ] ); } } }