Skip to main content
2 of 2
added 1 character in body
revive
  • 225
  • 3
  • 11

Or something along these lines - adapt as needed: (this is to 1) add a menu item for Gravity Forms and 2) show the count of all unread form IDs in the array. You can extend this with submenu pages for specific forms, with their own counts if needed.

add_action( 'admin_menu', 'register_my_custom_menu_page' );

// let's build the function
function register_my_custom_menu_page() {

    $search_criteria = array(
        'status'     => 'active', // Active forms 
        'field_filters' => array( // which fields to search
            array(
                'key' => 'is_read', 'value' => false, // let's just get the count for entries that we haven't read yet.
            )
          )
        );

    // Add the form IDs to the array below, the parent menu will show ALL unread entries for these forms
    // NOTE: you can get counts for whatever you're wanting and change the value of $notification_count below accordingly. 
    $notification_count = GFAPI::count_entries( array(1,4,5,6,11,13), $search_criteria );
    
    add_menu_page(
        'Full Quote Form submissions', // Page Title
        $notification_count ? sprintf( 'Quotes <span class="awaiting-mod">%d</span>', $notification_count ) : 'View Quotes',
        'manage_options', // Capabilities 
        'admin.php?page=gf_entries&id=13', // menu slug
        '', // callback function
        'dashicons-format-aside', // icon URL
        6 // position
    );
}
revive
  • 225
  • 3
  • 11