Changeset 40965 for trunk/src/wp-includes/cron.php
- Timestamp:
- 06/30/2017 12:21:49 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/cron.php
r38357 r40965 192 192 193 193 /** 194 * Unschedule all events attached to the specified hook.194 * Unschedule all events attached to the hook with the specified arguments. 195 195 * 196 196 * @since 2.1.0 … … 220 220 } 221 221 } 222 } 223 224 /** 225 * Unschedule all events attached to the hook. 226 * 227 * Can be useful for plugins when deactivating to clean up the cron queue. 228 * 229 * @since 4.9.0 230 * 231 * @param string $hook Action hook, the execution of which will be unscheduled. 232 */ 233 function wp_unschedule_hook( $hook ) { 234 $crons = _get_cron_array(); 235 236 foreach( $crons as $timestamp => $args ) { 237 unset( $crons[ $timestamp ][ $hook ] ); 238 239 if ( empty( $crons[ $timestamp ] ) ) { 240 unset( $crons[ $timestamp ] ); 241 } 242 } 243 244 _set_cron_array( $crons ); 222 245 } 223 246
Note: See TracChangeset
for help on using the changeset viewer.