Changeset 3397926
- Timestamp:
- 11/18/2025 10:15:56 AM (5 months ago)
- Location:
- video-popup/trunk
- Files:
-
- 4 edited
-
includes/class-admin.php (modified) (3 diffs)
-
includes/class-onpageload.php (modified) (1 diff)
-
includes/class-shortcode-reference-page.php (modified) (1 diff)
-
uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
video-popup/trunk/includes/class-admin.php
r3397512 r3397926 71 71 add_action('admin_init', array($this, 'register_settings_fields')); 72 72 add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_script')); 73 add_action('admin_head', array($this, 'admin_notify')); 73 74 } 74 75 … … 93 94 update_option($this->get_const('settings_key') . '_first_use', 'used'); 94 95 } 96 } 97 98 if ( !get_option($this->get_const('settings_key') . '_admin_notify') ) { 99 update_option($this->get_const('settings_key') . '_admin_notify', 'shown'); 95 100 } 96 101 … … 135 140 array($this, 'render_page') 136 141 ); 142 } 143 144 /** 145 * Adds visual admin notifications to the plugin menu 146 * when the admin_notify option is not enabled. 147 */ 148 public function admin_notify() { 149 if ( !get_option($this->get_const('settings_key') . '_admin_notify') ) { 150 ?> 151 <style> 152 li.toplevel_page_video_popup > a.toplevel_page_video_popup{ 153 background-color: #409b1a !important; 154 font-weight: 500 !important; 155 } 156 </style> 157 <script> 158 document.addEventListener('DOMContentLoaded', function () { 159 const vpMainMenuLabel = document.querySelector( 160 'li.toplevel_page_video_popup > a.toplevel_page_video_popup .wp-menu-name' 161 ); 162 163 const vpSubmenuFirstItem = document.querySelector( 164 'li.toplevel_page_video_popup .wp-submenu li.wp-first-item > a' 165 ); 166 167 if (vpMainMenuLabel) { 168 const vpBadgeMain = document.createElement('span'); 169 vpBadgeMain.className = 'update-plugins count-1'; 170 vpBadgeMain.innerHTML = '<span class="plugin-count">1</span>'; 171 vpMainMenuLabel.append(' ', vpBadgeMain); 172 } 173 174 if (vpSubmenuFirstItem) { 175 const vpBadgeSub = document.createElement('span'); 176 vpBadgeSub.className = 'update-plugins count-1'; 177 vpBadgeSub.innerHTML = '<span class="plugin-count">1</span>'; 178 vpSubmenuFirstItem.append(' ', vpBadgeSub); 179 } 180 }); 181 </script> 182 <?php 183 } 137 184 } 138 185 -
video-popup/trunk/includes/class-onpageload.php
r3397512 r3397926 108 108 update_option($this->get_const('settings_key') . '_first_use', 'used'); 109 109 } 110 } 111 112 if ( !get_option($this->get_const('settings_key') . '_admin_notify') ) { 113 update_option($this->get_const('settings_key') . '_admin_notify', 'shown'); 110 114 } 111 115 -
video-popup/trunk/includes/class-shortcode-reference-page.php
r3397512 r3397926 87 87 if ( isset($_GET['page']) && $_GET['page'] != $this->get_const('plugin_id') . '_shortcode' ) { 88 88 return; 89 } 90 91 if ( !get_option($this->get_const('settings_key') . '_admin_notify') ) { 92 update_option($this->get_const('settings_key') . '_admin_notify', 'shown'); 89 93 } 90 94 -
video-popup/trunk/uninstall.php
r3397512 r3397926 6 6 delete_option('video_popup_settings_onpage_load'); 7 7 delete_option('video_popup_settings_first_use'); 8 delete_option('video_popup_settings_admin_notify');
Note: See TracChangeset
for help on using the changeset viewer.