Changeset 1894854
- Timestamp:
- 06/19/2018 12:22:14 AM (8 years ago)
- Location:
- wp-dashboard/trunk
- Files:
-
- 6 edited
-
includes/class-wpdashboard-activator.php (modified) (1 diff)
-
includes/class-wpdashboard-deactivator.php (modified) (1 diff)
-
webhooks/lib/class-wpdashboard-plugins.php (modified) (4 diffs)
-
webhooks/lib/class-wpdashboard-themes.php (modified) (1 diff)
-
webhooks/lib/class-wpdashboard-users.php (modified) (1 diff)
-
wpdashboard.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-dashboard/trunk/includes/class-wpdashboard-activator.php
r1809618 r1894854 38 38 } 39 39 } 40 if (! wp_next_scheduled ( 'wpdashboard_send_updates_available', [] )) { 41 wp_schedule_event( time(), 'hourly', 'wpdashboard_send_updates_available', [] ); 42 } 40 43 } 41 44 -
wp-dashboard/trunk/includes/class-wpdashboard-deactivator.php
r1821677 r1894854 41 41 delete_option('wpdashboard_admin_user'); 42 42 delete_option('wpdashboard_tag_manager_id'); 43 44 wp_clear_scheduled_hook( 'wpdashboard_send_updates_available' ); 43 45 } 44 46 -
wp-dashboard/trunk/webhooks/lib/class-wpdashboard-plugins.php
r1847202 r1894854 27 27 trait Wpdashboard_Plugins { 28 28 29 /** 30 * Init Plugins 31 * 32 * Initialize the Wordpress Plugins 33 * class and add the actions to the 34 * specified hooks required. 35 * 36 * @since 2.0.0 37 * 38 * @return void 39 */ 29 40 public function initPlugins() { 30 41 // add_action( 'activated_plugin', [$this, 'plugin_installed'], 10, 2); … … 34 45 } 35 46 47 /** 48 * Plugin Installed 49 * 50 * Fires when a plugin is installed. 51 * 52 * @since 2.0.0 53 * 54 * @param $plugin 55 * @param $network_activation 56 */ 36 57 public function plugin_installed($plugin, $network_activation) { 37 58 //TODO:: Implement Plugin Installation Tracking 38 59 } 39 60 61 /** 62 * Plugin Activated 63 * 64 * Fires when a plugin is activated. 65 * 66 * @since 2.0.0 67 * 68 * @param $plugin 69 * @param $network_activation 70 */ 40 71 public function plugin_activated($plugin, $network_activation) { 41 72 $body = [ … … 47 78 } 48 79 80 /** 81 * Plugin Deactivated 82 * 83 * Fires when a plugin is deactivated. 84 * 85 * @since 2.0.0 86 * 87 * @param $plugin 88 * @param $network_deactivation 89 */ 49 90 public function plugin_deactivated($plugin, $network_deactivation) { 50 91 $body = [ … … 56 97 } 57 98 99 /** 100 * Plugin Deleted 101 * 102 * Fires when a plugin is deleted. 103 * 104 * @since 2.0.0 105 * 106 * @param $plugin 107 * @param $deleted 108 */ 58 109 public function plugin_deleted($plugin, $deleted) { 59 110 $body = [ -
wp-dashboard/trunk/webhooks/lib/class-wpdashboard-themes.php
r1847202 r1894854 27 27 trait Wpdashboard_Themes { 28 28 29 /** 30 * Init Themes 31 * 32 * Initialize the Wordpress Themes 33 * class and add the actions to the 34 * specified hooks required. 35 * 36 * @since 2.0.0 37 * 38 * @return void 39 */ 29 40 public function initThemes() { 30 41 add_action( 'switch_theme', [$this, 'theme_switched'], 10, 3); 31 42 } 32 43 44 /** 45 * Theme Switched 46 * 47 * Fires when a theme is switched. 48 * 49 * @since 2.0.0 50 * 51 * @param $new_name 52 * @param $new_theme 53 * @param $old_theme 54 */ 33 55 public function theme_switched($new_name, $new_theme, $old_theme) { 34 56 $body = [ -
wp-dashboard/trunk/webhooks/lib/class-wpdashboard-users.php
r1847202 r1894854 27 27 trait Wpdashboard_Users { 28 28 29 /** 30 * Init Users 31 * 32 * Initialize the Wordpress Users 33 * class and add the actions to the 34 * specified hooks required. 35 * 36 * @since 2.0.0 37 * 38 * @return void 39 */ 29 40 public function initUsers() { 41 add_action( 'user_register', [$this, 'user_registered'], 10, 1); 30 42 add_action( 'switch_theme', [$this, 'theme_switched'], 10, 3); 31 43 } 32 44 45 /** 46 * User Registered 47 * 48 * Fires when a new user is registered. 49 * 50 * @since 2.0.0 51 * 52 * @param $user_id 53 */ 54 public function user_registered($user_id) { 55 $user = get_user_by('ID', $user_id); 56 $body = [ 57 'user' => $user, 58 ]; 59 parent::post('user/registered', $body); 60 } 61 62 /** 63 * Update User 64 * 65 * Fires when a user is updated. 66 * 67 * @since 2.0.0 68 * 69 * @param $new_name 70 * @param $new_theme 71 * @param $old_theme 72 */ 33 73 public function theme_switched($new_name, $new_theme, $old_theme) { 34 74 $body = [ -
wp-dashboard/trunk/wpdashboard.php
r1824829 r1894854 59 59 */ 60 60 require plugin_dir_path( __FILE__ ) . 'includes/class-wpdashboard.php'; 61 require plugin_dir_path( __FILE__ ) . 'includes/class-wpdashboard-updates.php'; 61 62 62 63 /** … … 74 75 $plugin->run(); 75 76 77 add_action( 'wpdashboard_send_updates_available', 'wpdashboard_send_updates_available_now', 10, 2 ); 78 76 79 } 77 80 … … 82 85 } 83 86 87 function wpdashboard_send_updates_available_now($args_1, $args_2 ) { 88 WpDashboard_Updates::send(); 89 } 90 84 91 run_wpdashboard();
Note: See TracChangeset
for help on using the changeset viewer.