| @@ -63,9 +63,25 @@ | ||
| 63 | 63 | |
| 64 | 64 | add_filter('plugin_action_links_' . plugin_basename(DB_RESET_FILE), array($this, 'plugin_action_links')); |
| 65 | 65 | add_filter('plugin_row_meta', array($this, 'plugin_meta_links'), 10, 2); |
| 66 | 66 | add_filter('admin_footer_text', array($this, 'admin_footer_text')); |
| 67 | + add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts')); | |
| 67 | 68 | } |
| 69 | + | |
| 70 | + public function admin_enqueue_scripts() { | |
| 71 | + $current_screen = get_current_screen(); | |
| 72 | + if ($current_screen->id != 'plugins') { | |
| 73 | + return; | |
| 74 | + } | |
| 75 | + | |
| 76 | + wp_enqueue_script('db-reset', plugins_url('assets/js/database-reset-plugins.js', __FILE__), array('jquery'), $this->version, true); | |
| 77 | + | |
| 78 | + $vars = array(); | |
| 79 | + $vars['info_link'] = admin_url('plugin-install.php?tab=plugin-information&plugin=wp-reset&TB_iframe=true&width=600&height=800'); | |
| 80 | + $vars['install_link'] = wp_nonce_url(add_query_arg(array('action' => 'install-plugin', 'plugin' => 'wp-reset'), admin_url('update.php')), 'install-plugin_wp-reset'); | |
| 81 | + | |
| 82 | + wp_localize_script('db-reset', 'db_reset', $vars); | |
| 83 | + } // admin_enqueue | |
| 68 | 84 | |
| 69 | 85 | |
| 70 | 86 | // additional powered by text in admin footer; only on plugin's page |
| 71 | 87 | static function admin_footer_text($text) |