jetpack_stats_dashboard_widget_show_to_user

jetpack_stats_dashboard_widget_show_to_user

Hook Type: filter

See hook in core

Displaying hooks found in version: jetpack.15.0

apply_filters('jetpack_stats_dashboard_widget_show_to_user') is found 1 times:

  • /class-jetpack-stats-dashboard-widget.php line 57
    		 */
    		// Temporarily show the widget to administrators for Simple sites as the view_stats capability is not available.
    		// TODO: Grant the view_stats capability to corresponding users for Simple sites.
    		$can_user_view_stats = current_user_can( 'manage_options' ) || current_user_can( 'view_stats' );
    		if ( ! apply_filters( 'jetpack_stats_dashboard_widget_show_to_user', $can_user_view_stats ) ) {
    			return;
    		}
    
    		if ( Jetpack::is_connection_ready() && Jetpack::is_module_active( 'stats' ) ) {
    			add_action( 'admin_head', array( static::class, 'admin_head' ) );