Skip to content

Commit

Permalink
Only display the sparkline in the sidebar for Atomic sites if the `st…
Browse files Browse the repository at this point in the history
…ats_get_image_chart_src` exists
  • Loading branch information
Copons committed Nov 11, 2021
1 parent eadfa7f commit 70913e0
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,11 @@ public function get_upsell_nudge() {
public function add_stats_menu() {
$menu_title = __( 'Stats', 'jetpack' );

if ( ! $this->is_api_request && \Jetpack::is_module_active( 'stats' ) ) {
if (
! $this->is_api_request &&
\Jetpack::is_module_active( 'stats' ) &&
function_exists( 'stats_get_image_chart_src' )
) {
$img_src = esc_attr(
stats_get_image_chart_src( 'admin-bar-hours-scale-2x', array( 'masterbar' => '' ) )
);
Expand Down

0 comments on commit 70913e0

Please sign in to comment.