Skip to content

Commit adb6131

Browse files
authored
enhance: Add filter for hf_hide_admin_menu to toggle moving admin menu (#16)
1 parent e293706 commit adb6131

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/HtmlForms.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,17 @@ protected function cleanAdmin()
5555
echo '<style>.hf-sidebar { display: none; }</style>';
5656
});
5757

58-
add_filter('admin_menu', function () {
59-
remove_menu_page('html-forms');
60-
add_submenu_page(
61-
'options-general.php',
62-
'HTML Forms',
63-
'HTML Forms',
64-
'edit_forms',
65-
'html-forms'
66-
);
67-
});
58+
if (apply_filters('hf_hide_admin_menu', true)) {
59+
add_filter('admin_menu', function () {
60+
remove_menu_page('html-forms');
61+
add_submenu_page(
62+
'options-general.php',
63+
'HTML Forms',
64+
'HTML Forms',
65+
'edit_forms',
66+
'html-forms'
67+
);
68+
});
69+
}
6870
}
6971
}

0 commit comments

Comments
 (0)