Changeset 3093593
- Timestamp:
- 05/28/2024 04:00:33 AM (22 months ago)
- Location:
- sweepwidget/tags/2.0.4/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (1 diff)
-
sweepwidget.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sweepwidget/tags/2.0.4/trunk/readme.txt
r3093586 r3093593 214 214 = 2.0.3 = 215 215 * More seamless plugin installation. 216 217 = 2.0.4 = 218 * Fixed a bug on the main page. 219 220 = 2.0.5 = 221 * Redirect user to plugin on activation. Update URL path for SweepWidget plugin. -
sweepwidget/tags/2.0.4/trunk/sweepwidget.php
r3093586 r3093593 14 14 */ 15 15 16 function sweepwidget_add_menu() { 17 18 add_menu_page( 'SweepWidget Contests', 19 'SweepWidget Contests', 20 'manage_options', 21 'account', 22 'sweepwidget_admin_menu_main', 23 'dashicons-awards', 24 21); 25 16 function sweepwidget_add_menu() 17 { 18 19 add_menu_page( 20 'SweepWidget Contests', 21 'SweepWidget Contests', 22 'manage_options', 23 'account', 24 'sweepwidget_admin_menu_main', 25 'dashicons-awards', 26 21 27 ); 26 28 } 27 29 28 30 add_action('admin_menu', 'sweepwidget_add_menu'); 31 32 // Hook into the admin initialization process 33 add_action('admin_init', 'sweepwidget_redirect_to_admin'); 34 35 function sweepwidget_redirect_to_admin() 36 { 37 // Check if our option is set 38 if (get_option('sweepwidget_plugin_activated', false)) { 39 // Delete the option to prevent the redirect on every admin page load 40 delete_option('sweepwidget_plugin_activated'); 41 42 // Perform the redirect 43 wp_redirect(admin_url('admin.php?page=sweepwidget')); 44 exit; 45 } 46 } 47 48 // Hook into the activation process 49 register_activation_hook(__FILE__, 'sweepwidget_activate'); 50 51 function sweepwidget_activate() 52 { 53 // Set an option to trigger the redirect 54 add_option('sweepwidget_plugin_activated', true); 55 } 29 56 30 57 // Convert language abbr to full text
Note: See TracChangeset
for help on using the changeset viewer.