From 390de33ef11a2941de5923e23c5df390314add17 Mon Sep 17 00:00:00 2001 From: David Smith Date: Thu, 30 Jan 2025 11:50:39 -0500 Subject: [PATCH] `gfcc-add-in-use-menu-indicator.php`: Added new snippet. --- .../gfcc-add-in-use-menu-indicator.php | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 gf-code-chest/gfcc-add-in-use-menu-indicator.php diff --git a/gf-code-chest/gfcc-add-in-use-menu-indicator.php b/gf-code-chest/gfcc-add-in-use-menu-indicator.php new file mode 100644 index 00000000..fd670fbe --- /dev/null +++ b/gf-code-chest/gfcc-add-in-use-menu-indicator.php @@ -0,0 +1,25 @@ +get_custom_js( $form ) ); + $has_css_code = ! empty( gwiz_gf_code_chest()->get_custom_css( $form ) ); + + // If there is code in either setting, append the ✔ symbol to the Code Chest menu item + if ( $has_js_code || $has_css_code ) { + foreach ( $menu_items as &$menu_item ) { + if ( $menu_item['name'] === 'gf-code-chest' ) { + $menu_item['label'] .= ' ✔'; + break; + } + } + } + + return $menu_items; +}, 16, 2 );