The gform_system_status_menu filter allows you to modify the menu items displayed on the Gravity Forms System Status page.
Usage
add_filter('gform_system_status_menu', 'your_function_name'); function your_function_name($subviews) { // your custom code here return $subviews; }
Parameters
$subviews
(array): An array of menu items to be displayed on the System Status page.
More information
See Gravity Forms Docs: gform_system_status_menu
This filter was added in version 2.2.
Place this code in the functions.php
file of your active theme.
Source code location: system_status.php
Examples
Add a new menu item
This example adds a new menu item called "Custom Menu Item" that links to a custom page.
add_filter('gform_system_status_menu', 'add_custom_menu_item');
function add_custom_menu_item($subviews) {
$subviews['custom_menu_item'] = array(
'label' => 'Custom Menu Item',
'url' => 'https://yourwebsite.com/custom-page'
);
return $subviews;
}
Remove a specific menu item
This example removes the "Environment" menu item from the System Status page.
add_filter('gform_system_status_menu', 'remove_environment_menu_item');
function remove_environment_menu_item($subviews) {
unset($subviews['environment']);
return $subviews;
}
Change the label of a menu item
This example changes the label of the "Tools" menu item to "Gravity Tools".
add_filter('gform_system_status_menu', 'change_tools_label');
function change_tools_label($subviews) {
$subviews['tools']['label'] = 'Gravity Tools';
return $subviews;
}
Modify the URL of a menu item
This example changes the URL of the "Tools" menu item to a custom URL.
add_filter('gform_system_status_menu', 'change_tools_url');
function change_tools_url($subviews) {
$subviews['tools']['url'] = 'https://yourwebsite.com/custom-tools-page';
return $subviews;
}
Reorder menu items
This example reorders the menu items on the System Status page, moving the "Tools" menu item to the top.
add_filter('gform_system_status_menu', 'reorder_menu_items');
function reorder_menu_items($subviews) {
$tools = $subviews['tools'];
unset($subviews['tools']);
array_unshift($subviews, $tools);
return $subviews;
}