The gform_dashboard_title filter allows you to change the title of the forms statistics section displayed on the WordPress Dashboard.
Usage
add_filter('gform_dashboard_title', 'set_dashboard_title'); function set_dashboard_title() { // your custom code here return "New Dashboard Title"; }
Parameters
- No parameters for this filter.
More information
See Gravity Forms Docs: gform_dashboard_title
Place this code in the functions.php
file of your active theme.
Examples
Change Dashboard Title
Change the title of the forms statistics section to “My Custom Forms Dashboard”.
add_filter('gform_dashboard_title', 'set_custom_dashboard_title'); function set_custom_dashboard_title() { return "My Custom Forms Dashboard"; }
Add a Dynamic Date to the Dashboard Title
Add today’s date to the dashboard title.
add_filter('gform_dashboard_title', 'add_date_to_dashboard_title'); function add_date_to_dashboard_title() { return "Forms Dashboard - " . date("F j, Y"); }
Display the Number of Forms in the Dashboard Title
Show the total number of forms in the dashboard title.
add_filter('gform_dashboard_title', 'display_form_count_in_dashboard_title'); function display_form_count_in_dashboard_title() { $form_count = GFAPI::count_forms(); return "Forms Dashboard ({$form_count} Forms)"; }
Add Emojis to the Dashboard Title
Add emojis to the dashboard title.
add_filter('gform_dashboard_title', 'add_emojis_to_dashboard_title'); function add_emojis_to_dashboard_title() { return "Forms Dashboard 🚀✨"; }
Combine Multiple Elements in the Dashboard Title
Combine custom text, date, and form count in the dashboard title.
add_filter('gform_dashboard_title', 'create_custom_dashboard_title'); function create_custom_dashboard_title() { $form_count = GFAPI::count_forms(); $date = date("F j, Y"); return "My Custom Forms Dashboard ({$form_count} Forms) - {$date}"; }