/var/www/wordpress/wp-admin/includes/admin.php
/var/www/wordpress/wp-admin/includes/bookmark.php
/var/www/wordpress/wp-admin/includes/class-ftp-pure.php
/var/www/wordpress/wp-admin/includes/class-ftp-sockets.php
/var/www/wordpress/wp-admin/includes/class-ftp.php
/var/www/wordpress/wp-admin/includes/class-pclzip.php
/var/www/wordpress/wp-admin/includes/class-wp-filesystem-base.php
/var/www/wordpress/wp-admin/includes/class-wp-filesystem-direct.php
/var/www/wordpress/wp-admin/includes/class-wp-filesystem-ftpext.php
/var/www/wordpress/wp-admin/includes/class-wp-filesystem-ftpsockets.php
/var/www/wordpress/wp-admin/includes/class-wp-filesystem-ssh2.php
/var/www/wordpress/wp-admin/includes/class-wp-importer.php
/var/www/wordpress/wp-admin/includes/class-wp-upgrader.php
/var/www/wordpress/wp-admin/includes/comment.php
/var/www/wordpress/wp-admin/includes/continents-cities.php
/var/www/wordpress/wp-admin/includes/dashboard.php
/var/www/wordpress/wp-admin/includes/deprecated.php
/var/www/wordpress/wp-admin/includes/export.php
/var/www/wordpress/wp-admin/includes/file.php
/var/www/wordpress/wp-admin/includes/image-edit.php
/var/www/wordpress/wp-admin/includes/image.php
/var/www/wordpress/wp-admin/includes/import.php
/var/www/wordpress/wp-admin/includes/manifest.php
/var/www/wordpress/wp-admin/includes/media.php
/var/www/wordpress/wp-admin/includes/meta-boxes.php
/var/www/wordpress/wp-admin/includes/misc.php
/var/www/wordpress/wp-admin/includes/ms-deprecated.php
/var/www/wordpress/wp-admin/includes/ms.php
/var/www/wordpress/wp-admin/includes/nav-menu.php
/var/www/wordpress/wp-admin/includes/plugin-install.php
/var/www/wordpress/wp-admin/includes/plugin.php
/var/www/wordpress/wp-admin/includes/post.php
/var/www/wordpress/wp-admin/includes/schema.php
/var/www/wordpress/wp-admin/includes/taxonomy.php
/var/www/wordpress/wp-admin/includes/template.php
/var/www/wordpress/wp-admin/includes/theme-install.php
/var/www/wordpress/wp-admin/includes/theme.php
/var/www/wordpress/wp-admin/includes/update-core.php
/var/www/wordpress/wp-admin/includes/update.php
/var/www/wordpress/wp-admin/includes/upgrade.php
/var/www/wordpress/wp-admin/includes/user.php
/var/www/wordpress/wp-admin/includes/widgets.php
/var/www/wordpress/wp-admin/js/revisions-js.php
/var/www/wordpress/wp-admin/maint/repair.php
/var/www/wordpress/wp-admin/admin-ajax.php
/var/www/wordpress/wp-admin/admin-footer.php
/var/www/wordpress/wp-admin/admin-functions.php
/var/www/wordpress/wp-admin/admin-header.php
/var/www/wordpress/wp-admin/admin-post.php
/var/www/wordpress/wp-admin/admin.php
/var/www/wordpress/wp-admin/async-upload.php
/var/www/wordpress/wp-admin/comment.php
/var/www/wordpress/wp-admin/custom-background.php
/var/www/wordpress/wp-admin/custom-header.php
/var/www/wordpress/wp-admin/edit-attachment-rows.php
/var/www/wordpress/wp-admin/edit-comments.php
/var/www/wordpress/wp-admin/edit-form-advanced.php
/var/www/wordpress/wp-admin/edit-form-comment.php
/var/www/wordpress/wp-admin/edit-link-categories.php
/var/www/wordpress/wp-admin/edit-link-category-form.php
/var/www/wordpress/wp-admin/edit-link-form.php
/var/www/wordpress/wp-admin/edit-post-rows.php
/var/www/wordpress/wp-admin/edit-tag-form.php
/var/www/wordpress/wp-admin/edit-tags.php
/var/www/wordpress/wp-admin/edit.php
/var/www/wordpress/wp-admin/export.php
/var/www/wordpress/wp-admin/gears-manifest.php
/var/www/wordpress/wp-admin/import.php
/var/www/wordpress/wp-admin/index-extra.php
/var/www/wordpress/wp-admin/index.php
/var/www/wordpress/wp-admin/install-helper.php
/var/www/wordpress/wp-admin/install.php
/var/www/wordpress/wp-admin/link-add.php
/var/www/wordpress/wp-admin/link-category.php
/var/www/wordpress/wp-admin/link-manager.php
/var/www/wordpress/wp-admin/link-parse-opml.php
/var/www/wordpress/wp-admin/link.php
/var/www/wordpress/wp-admin/load-scripts.php
/var/www/wordpress/wp-admin/load-styles.php
/var/www/wordpress/wp-admin/media-new.php
/var/www/wordpress/wp-admin/media-upload.php
/var/www/wordpress/wp-admin/media.php
/var/www/wordpress/wp-admin/menu-header.php
/var/www/wordpress/wp-admin/menu.php
/var/www/wordpress/wp-admin/moderation.php
/var/www/wordpress/wp-admin/ms-admin.php
/var/www/wordpress/wp-admin/ms-delete-site.php
/var/www/wordpress/wp-admin/ms-edit.php
/var/www/wordpress/wp-admin/ms-options.php
/var/www/wordpress/wp-admin/ms-sites.php
/var/www/wordpress/wp-admin/ms-themes.php
/var/www/wordpress/wp-admin/ms-upgrade-network.php
/var/www/wordpress/wp-admin/ms-users.php
/var/www/wordpress/wp-admin/my-sites.php
/var/www/wordpress/wp-admin/nav-menus.php
/var/www/wordpress/wp-admin/network.php
/var/www/wordpress/wp-admin/options-discussion.php
/var/www/wordpress/wp-admin/options-general.php
/var/www/wordpress/wp-admin/options-head.php
/var/www/wordpress/wp-admin/options-media.php
/var/www/wordpress/wp-admin/options-permalink.php
/var/www/wordpress/wp-admin/options-privacy.php
/var/www/wordpress/wp-admin/options-reading.php
/var/www/wordpress/wp-admin/options-writing.php
/var/www/wordpress/wp-admin/options.php
/var/www/wordpress/wp-admin/plugin-editor.php
/var/www/wordpress/wp-admin/plugin-install.php
/var/www/wordpress/wp-admin/plugins.php
/var/www/wordpress/wp-admin/post-new.php
/var/www/wordpress/wp-admin/post.php
/var/www/wordpress/wp-admin/press-this.php
/var/www/wordpress/wp-admin/profile.php
/var/www/wordpress/wp-admin/revision.php
/var/www/wordpress/wp-admin/setup-config.php
/var/www/wordpress/wp-admin/sidebar.php
/var/www/wordpress/wp-admin/theme-editor.php
/var/www/wordpress/wp-admin/theme-install.php
/var/www/wordpress/wp-admin/themes.php
/var/www/wordpress/wp-admin/tools.php
/var/www/wordpress/wp-admin/update-core.php
/var/www/wordpress/wp-admin/update.php
/var/www/wordpress/wp-admin/upgrade-functions.php
/var/www/wordpress/wp-admin/upgrade.php
/var/www/wordpress/wp-admin/upload.php
/var/www/wordpress/wp-admin/user-edit.php
/var/www/wordpress/wp-admin/user-new.php
/var/www/wordpress/wp-admin/users.php
/var/www/wordpress/wp-admin/widgets.php
/var/www/wordpress/wp-content/languages/ru_RU.php
/var/www/wordpress/wp-content/plugins/akismet/akismet.php
/var/www/wordpress/wp-content/plugins/rh/rh.php
/var/www/wordpress/wp-content/plugins/hello.php
/var/www/wordpress/wp-content/plugins/index.php
/var/www/wordpress/wp-content/themes/twentyten/404.php
/var/www/wordpress/wp-content/themes/twentyten/archive.php
/var/www/wordpress/wp-content/themes/twentyten/attachment.php
/var/www/wordpress/wp-content/themes/twentyten/author.php
/var/www/wordpress/wp-content/themes/twentyten/category.php
/var/www/wordpress/wp-content/themes/twentyten/comments.php
/var/www/wordpress/wp-content/themes/twentyten/footer.php
/var/www/wordpress/wp-content/themes/twentyten/functions.php
/var/www/wordpress/wp-content/themes/twentyten/header.php
/var/www/wordpress/wp-content/themes/twentyten/index.php
/var/www/wordpress/wp-content/themes/twentyten/loop.php
/var/www/wordpress/wp-content/themes/twentyten/onecolumn-page.php
/var/www/wordpress/wp-content/themes/twentyten/page.php
/var/www/wordpress/wp-content/themes/twentyten/search.php
/var/www/wordpress/wp-content/themes/twentyten/sidebar-footer.php
/var/www/wordpress/wp-content/themes/twentyten/sidebar.php
/var/www/wordpress/wp-content/themes/twentyten/single.php
/var/www/wordpress/wp-content/themes/twentyten/tag.php
/var/www/wordpress/wp-content/themes/index.php
/var/www/wordpress/wp-content/index.php
/var/www/wordpress/wp-includes/js/tinymce/langs/wp-langs.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/utils/JSON.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/utils/Logger.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/EnchantSpell.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/GoogleSpell.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/PSpell.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/PSpellShell.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/SpellChecker.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/includes/general.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/config.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/rpc.php
/var/www/wordpress/wp-includes/js/tinymce/wp-mce-help.php
/var/www/wordpress/wp-includes/js/tinymce/wp-tinymce.php
/var/www/wordpress/wp-includes/pomo/entry.php
/var/www/wordpress/wp-includes/pomo/mo.php
/var/www/wordpress/wp-includes/pomo/po.php
/var/www/wordpress/wp-includes/pomo/streams.php
/var/www/wordpress/wp-includes/pomo/translations.php
/var/www/wordpress/wp-includes/Text/Diff/Engine/native.php
/var/www/wordpress/wp-includes/Text/Diff/Engine/shell.php
/var/www/wordpress/wp-includes/Text/Diff/Engine/string.php
/var/www/wordpress/wp-includes/Text/Diff/Engine/xdiff.php
/var/www/wordpress/wp-includes/Text/Diff/Renderer/inline.php
/var/www/wordpress/wp-includes/Text/Diff/Renderer.php
/var/www/wordpress/wp-includes/Text/Diff.php
/var/www/wordpress/wp-includes/theme-compat/comments-popup.php
/var/www/wordpress/wp-includes/theme-compat/comments.php
/var/www/wordpress/wp-includes/theme-compat/footer.php
/var/www/wordpress/wp-includes/theme-compat/header.php
/var/www/wordpress/wp-includes/theme-compat/sidebar.php
/var/www/wordpress/wp-includes/atomlib.php
/var/www/wordpress/wp-includes/author-template.php
/var/www/wordpress/wp-includes/bookmark-template.php
/var/www/wordpress/wp-includes/bookmark.php
/var/www/wordpress/wp-includes/cache.php
/var/www/wordpress/wp-includes/canonical.php
/var/www/wordpress/wp-includes/capabilities.php
/var/www/wordpress/wp-includes/category-template.php
/var/www/wordpress/wp-includes/category.php
/var/www/wordpress/wp-includes/class-feed.php
/var/www/wordpress/wp-includes/class-http.php
/var/www/wordpress/wp-includes/class-IXR.php
/var/www/wordpress/wp-includes/class-json.php
/var/www/wordpress/wp-includes/class-oembed.php
/var/www/wordpress/wp-includes/class-phpass.php
/var/www/wordpress/wp-includes/class-phpmailer.php
/var/www/wordpress/wp-includes/class-pop3.php
/var/www/wordpress/wp-includes/class-simplepie.php
/var/www/wordpress/wp-includes/class-smtp.php
/var/www/wordpress/wp-includes/class-snoopy.php
/var/www/wordpress/wp-includes/class.wp-dependencies.php
/var/www/wordpress/wp-includes/class.wp-scripts.php
/var/www/wordpress/wp-includes/class.wp-styles.php
/var/www/wordpress/wp-includes/classes.php
/var/www/wordpress/wp-includes/comment-template.php
/var/www/wordpress/wp-includes/comment.php
/var/www/wordpress/wp-includes/compat.php
/var/www/wordpress/wp-includes/cron.php
#CodeDescriptions
1<?php
2/**
3 * WordPress CRON API
4 *
5 * @package WordPress
6 */
7
8/**
9 * Schedules a hook to run only once.
10 *
11 * Schedules a hook which will be executed once by the WordPress actions core at
12 * a time which you specify. The action will fire off when someone visits your
13 * WordPress site, if the schedule time has passed.
14 *
15 * @since 2.1.0
16 * @link http://codex.wordpress.org/Function_Reference/wp_schedule_single_event
17 *
18 * @param int $timestamp Timestamp for when to run the event.
19 * @param string $hook Action hook to execute when cron is run.
20 * @param array $args Optional. Arguments to pass to the hook's callback function.
21 */
22function wp_schedule_single_event( $timestamp, $hook, $args = array()) {
23 // don't schedule a duplicate if there's already an identical event due in the next 10 minutes
24 $next = wp_next_scheduled($hook, $args);
25 if ( $next && $next <= $timestamp + 600 )
26 return;
27
28 $crons = _get_cron_array();
29 $key = md5(serialize($args));
30 $crons[$timestamp][$hook][$key] = array( 'schedule' => false, 'args' => $args );
31 uksort( $crons, "strnatcasecmp" );
32 _set_cron_array( $crons );
33}
34
35/**
36 * Schedule a periodic event.
37 *
38 * Schedules a hook which will be executed by the WordPress actions core on a
39 * specific interval, specified by you. The action will trigger when someone
40 * visits your WordPress site, if the scheduled time has passed.
41 *
42 * Valid values for the recurrence are hourly, daily and twicedaily. These can
43 * be extended using the cron_schedules filter in wp_get_schedules().
44 *
45 * @since 2.1.0
46 *
47 * @param int $timestamp Timestamp for when to run the event.
48 * @param string $recurrence How often the event should recur.
49 * @param string $hook Action hook to execute when cron is run.
50 * @param array $args Optional. Arguments to pass to the hook's callback function.
51 * @return bool|null False on failure, null when complete with scheduling event.
52 */
53function wp_schedule_event( $timestamp, $recurrence, $hook, $args = array()) {
54 $crons = _get_cron_array();
55 $schedules = wp_get_schedules();
56 $key = md5(serialize($args));
57 if ( !isset( $schedules[$recurrence] ) )
58 return false;
59 $crons[$timestamp][$hook][$key] = array( 'schedule' => $recurrence, 'args' => $args, 'interval' => $schedules[$recurrence]['interval'] );
60 uksort( $crons, "strnatcasecmp" );
61 _set_cron_array( $crons );
62}
63
64/**
65 * Reschedule a recurring event.
66 *
67 * @since 2.1.0
68 *
69 * @param int $timestamp Timestamp for when to run the event.
70 * @param string $recurrence How often the event should recur.
71 * @param string $hook Action hook to execute when cron is run.
72 * @param array $args Optional. Arguments to pass to the hook's callback function.
73 * @return bool|null False on failure. Null when event is rescheduled.
74 */
75function wp_reschedule_event( $timestamp, $recurrence, $hook, $args = array()) {
76 $crons = _get_cron_array();
77 $schedules = wp_get_schedules();
78 $key = md5(serialize($args));
79 $interval = 0;
80
81 // First we try to get it from the schedule
82 if ( 0 == $interval )
83 $interval = $schedules[$recurrence]['interval'];
84 // Now we try to get it from the saved interval in case the schedule disappears
85 if ( 0 == $interval )
86 $interval = $crons[$timestamp][$hook][$key]['interval'];
87 // Now we assume something is wrong and fail to schedule
88 if ( 0 == $interval )
89 return false;
90
91 $now = time();
92
93 if ( $timestamp >= $now )
94 $timestamp = $now + $interval;
95 else
96 $timestamp = $now + ($interval - (($now - $timestamp) % $interval));
97
98 wp_schedule_event( $timestamp, $recurrence, $hook, $args );
99}
100
101/**
102 * Unschedule a previously scheduled cron job.
103 *
104 * The $timestamp and $hook parameters are required, so that the event can be
105 * identified.
106 *
107 * @since 2.1.0
108 *
109 * @param int $timestamp Timestamp for when to run the event.
110 * @param string $hook Action hook, the execution of which will be unscheduled.
111 * @param array $args Arguments to pass to the hook's callback function.
112 * Although not passed to a callback function, these arguments are used
113 * to uniquely identify the scheduled event, so they should be the same
114 * as those used when originally scheduling the event.
115 */
116function wp_unschedule_event( $timestamp, $hook, $args = array() ) {
117 $crons = _get_cron_array();
118 $key = md5(serialize($args));
119 unset( $crons[$timestamp][$hook][$key] );
120 if ( empty($crons[$timestamp][$hook]) )
121 unset( $crons[$timestamp][$hook] );
122 if ( empty($crons[$timestamp]) )
123 unset( $crons[$timestamp] );
124 _set_cron_array( $crons );
125}
126
127/**
128 * Unschedule all cron jobs attached to a specific hook.
129 *
130 * @since 2.1.0
131 *
132 * @param string $hook Action hook, the execution of which will be unscheduled.
133 * @param array $args Optional. Arguments that were to be pass to the hook's callback function.
134 */
135function wp_clear_scheduled_hook( $hook, $args = array() ) {
136 // Backward compatibility
137 // Previously this function took the arguments as discrete vars rather than an array like the rest of the API
138 if ( !is_array($args) ) {
139 _deprecated_argument( __FUNCTION__, '3.0.0', __('This argument has changed to an array to match the behavior of the other cron functions.') );
140 $args = array_slice( func_get_args(), 1 );
141 }
142
143 while ( $timestamp = wp_next_scheduled( $hook, $args ) )
144 wp_unschedule_event( $timestamp, $hook, $args );
145}
146
147/**
148 * Retrieve the next timestamp for a cron event.
149 *
150 * @since 2.1.0
151 *
152 * @param string $hook Action hook to execute when cron is run.
153 * @param array $args Optional. Arguments to pass to the hook's callback function.
154 * @return bool|int The UNIX timestamp of the next time the scheduled event will occur.
155 */
156function wp_next_scheduled( $hook, $args = array() ) {
157 $crons = _get_cron_array();
158 $key = md5(serialize($args));
159 if ( empty($crons) )
160 return false;
161 foreach ( $crons as $timestamp => $cron ) {
162 if ( isset( $cron[$hook][$key] ) )
163 return $timestamp;
164 }
165 return false;
166}
167
168/**
169 * Send request to run cron through HTTP request that doesn't halt page loading.
170 *
171 * @since 2.1.0
172 *
173 * @return null Cron could not be spawned, because it is not needed to run.
174 */
175function spawn_cron( $local_time = 0 ) {
176
177 if ( !$local_time )
178 $local_time = time();
179
180 if ( defined('DOING_CRON') || isset($_GET['doing_wp_cron']) )
181 return;
182
183 /*
184 * do not even start the cron if local server timer has drifted
185 * such as due to power failure, or misconfiguration
186 */
187 $timer_accurate = check_server_timer( $local_time );
188 if ( !$timer_accurate )
189 return;
190
191 /*
192 * multiple processes on multiple web servers can run this code concurrently
193 * try to make this as atomic as possible by setting doing_cron switch
194 */
195 $flag = get_transient('doing_cron');
196
197 if ( $flag > $local_time + 10*60 )
198 $flag = 0;
199
200 // don't run if another process is currently running it or more than once every 60 sec.
201 if ( $flag + 60 > $local_time )
202 return;
203
204 //sanity check
205 $crons = _get_cron_array();
206 if ( !is_array($crons) )
207 return;
208
209 $keys = array_keys( $crons );
210 if ( isset($keys[0]) && $keys[0] > $local_time )
211 return;
212
213 if ( defined('ALTERNATE_WP_CRON') && ALTERNATE_WP_CRON ) {
214 if ( !empty($_POST) || defined('DOING_AJAX') )
215 return;
216
217 set_transient( 'doing_cron', $local_time );
218
219 ob_start();
220 wp_redirect( add_query_arg('doing_wp_cron', '', stripslashes($_SERVER['REQUEST_URI'])) );
221 echo ' ';
222
223 // flush any buffers and send the headers
224 while ( @ob_end_flush() );
225 flush();
226
227 WP_DEBUG ? include_once( ABSPATH . 'wp-cron.php' ) : @include_once( ABSPATH . 'wp-cron.php' );
228 return;
229 }
230
231 set_transient( 'doing_cron', $local_time );
232
233 $cron_url = get_option( 'siteurl' ) . '/wp-cron.php?doing_wp_cron';
234 wp_remote_post( $cron_url, array('timeout' => 0.01, 'blocking' => false, 'sslverify' => apply_filters('https_local_ssl_verify', true)) );
235}
236
237/**
238 * Run scheduled callbacks or spawn cron for all scheduled events.
239 *
240 * @since 2.1.0
241 *
242 * @return null When doesn't need to run Cron.
243 */
244function wp_cron() {
245
246 // Prevent infinite loops caused by lack of wp-cron.php
247 if ( strpos($_SERVER['REQUEST_URI'], '/wp-cron.php') !== false || ( defined('DISABLE_WP_CRON') && DISABLE_WP_CRON ) )
248 return;
249
250 if ( false === $crons = _get_cron_array() )
251 return;
252
253 $local_time = time();
254 $keys = array_keys( $crons );
255 if ( isset($keys[0]) && $keys[0] > $local_time )
256 return;
257
258 $schedules = wp_get_schedules();
259 foreach ( $crons as $timestamp => $cronhooks ) {
260 if ( $timestamp > $local_time ) break;
261 foreach ( (array) $cronhooks as $hook => $args ) {
262 if ( isset($schedules[$hook]['callback']) && !call_user_func( $schedules[$hook]['callback'] ) )
263 continue;
264 spawn_cron( $local_time );
265 break 2;
266 }
267 }
268}
269
270/**
271 * Retrieve supported and filtered Cron recurrences.
272 *
273 * The supported recurrences are 'hourly' and 'daily'. A plugin may add more by
274 * hooking into the 'cron_schedules' filter. The filter accepts an array of
275 * arrays. The outer array has a key that is the name of the schedule or for
276 * example 'weekly'. The value is an array with two keys, one is 'interval' and
277 * the other is 'display'.
278 *
279 * The 'interval' is a number in seconds of when the cron job should run. So for
280 * 'hourly', the time is 3600 or 60*60. For weekly, the value would be
281 * 60*60*24*7 or 604800. The value of 'interval' would then be 604800.
282 *
283 * The 'display' is the description. For the 'weekly' key, the 'display' would
284 * be <code>__('Once Weekly')</code>.
285 *
286 * For your plugin, you will be passed an array. you can easily add your
287 * schedule by doing the following.
288 * <code>
289 * // filter parameter variable name is 'array'
290 * $array['weekly'] = array(
291 * 'interval' => 604800,
292 * 'display' => __('Once Weekly')
293 * );
294 * </code>
295 *
296 * @since 2.1.0
297 *
298 * @return array
299 */
300function wp_get_schedules() {
301 $schedules = array(
302 'hourly' => array( 'interval' => 3600, 'display' => __('Once Hourly') ),
303 'twicedaily' => array( 'interval' => 43200, 'display' => __('Twice Daily') ),
304 'daily' => array( 'interval' => 86400, 'display' => __('Once Daily') ),
305 );
306 return array_merge( apply_filters( 'cron_schedules', array() ), $schedules );
307}
308
309/**
310 * Retrieve Cron schedule for hook with arguments.
311 *
312 * @since 2.1.0
313 *
314 * @param string $hook Action hook to execute when cron is run.
315 * @param array $args Optional. Arguments to pass to the hook's callback function.
316 * @return string|bool False, if no schedule. Schedule on success.
317 */
318function wp_get_schedule($hook, $args = array()) {
319 $crons = _get_cron_array();
320 $key = md5(serialize($args));
321 if ( empty($crons) )
322 return false;
323 foreach ( $crons as $timestamp => $cron ) {
324 if ( isset( $cron[$hook][$key] ) )
325 return $cron[$hook][$key]['schedule'];
326 }
327 return false;
328}
329
330//
331// Private functions
332//
333
334/**
335 * Retrieve cron info array option.
336 *
337 * @since 2.1.0
338 * @access private
339 *
340 * @return array CRON info array.
341 */
342function _get_cron_array() {
343 $cron = get_option('cron');
344 if ( ! is_array($cron) )
345 return false;
346
347 if ( !isset($cron['version']) )
348 $cron = _upgrade_cron_array($cron);
349
350 unset($cron['version']);
351
352 return $cron;
353}
354
355/**
356 * Updates the CRON option with the new CRON array.
357 *
358 * @since 2.1.0
359 * @access private
360 *
361 * @param array $cron Cron info array from {@link _get_cron_array()}.
362 */
363function _set_cron_array($cron) {
364 $cron['version'] = 2;
365 update_option( 'cron', $cron );
366}
367
368/**
369 * Upgrade a Cron info array.
370 *
371 * This function upgrades the Cron info array to version 2.
372 *
373 * @since 2.1.0
374 * @access private
375 *
376 * @param array $cron Cron info array from {@link _get_cron_array()}.
377 * @return array An upgraded Cron info array.
378 */
379function _upgrade_cron_array($cron) {
380 if ( isset($cron['version']) && 2 == $cron['version'])
381 return $cron;
382
383 $new_cron = array();
384
385 foreach ( (array) $cron as $timestamp => $hooks) {
386 foreach ( (array) $hooks as $hook => $args ) {
387 $key = md5(serialize($args['args']));
388 $new_cron[$timestamp][$hook][$key] = $args;
389 }
390 }
391
392 $new_cron['version'] = 2;
393 update_option( 'cron', $new_cron );
394 return $new_cron;
395}
396
397// stub for checking server timer accuracy, using outside standard time sources
398function check_server_timer( $local_time ) {
399 return true;
400}
401
/var/www/wordpress/wp-includes/default-constants.php
/var/www/wordpress/wp-includes/default-embeds.php
/var/www/wordpress/wp-includes/default-filters.php
/var/www/wordpress/wp-includes/default-widgets.php
/var/www/wordpress/wp-includes/deprecated.php
/var/www/wordpress/wp-includes/feed-atom-comments.php
/var/www/wordpress/wp-includes/feed-atom.php
/var/www/wordpress/wp-includes/feed-rdf.php
/var/www/wordpress/wp-includes/feed-rss.php
/var/www/wordpress/wp-includes/feed-rss2-comments.php
/var/www/wordpress/wp-includes/feed-rss2.php
/var/www/wordpress/wp-includes/feed.php
/var/www/wordpress/wp-includes/formatting.php
/var/www/wordpress/wp-includes/functions.php
/var/www/wordpress/wp-includes/functions.wp-scripts.php
/var/www/wordpress/wp-includes/functions.wp-styles.php
/var/www/wordpress/wp-includes/general-template.php
/var/www/wordpress/wp-includes/http.php
/var/www/wordpress/wp-includes/kses.php
/var/www/wordpress/wp-includes/l10n.php
/var/www/wordpress/wp-includes/link-template.php
/var/www/wordpress/wp-includes/load.php
/var/www/wordpress/wp-includes/locale.php
/var/www/wordpress/wp-includes/media.php
/var/www/wordpress/wp-includes/meta.php
/var/www/wordpress/wp-includes/ms-blogs.php
/var/www/wordpress/wp-includes/ms-default-constants.php
/var/www/wordpress/wp-includes/ms-default-filters.php
/var/www/wordpress/wp-includes/ms-deprecated.php
/var/www/wordpress/wp-includes/ms-files.php
/var/www/wordpress/wp-includes/ms-functions.php
/var/www/wordpress/wp-includes/ms-load.php
/var/www/wordpress/wp-includes/ms-settings.php
/var/www/wordpress/wp-includes/nav-menu-template.php
/var/www/wordpress/wp-includes/nav-menu.php
/var/www/wordpress/wp-includes/pluggable-deprecated.php
/var/www/wordpress/wp-includes/pluggable.php
/var/www/wordpress/wp-includes/plugin.php
/var/www/wordpress/wp-includes/post-template.php
/var/www/wordpress/wp-includes/post-thumbnail-template.php
/var/www/wordpress/wp-includes/post.php
/var/www/wordpress/wp-includes/query.php
/var/www/wordpress/wp-includes/registration-functions.php
/var/www/wordpress/wp-includes/registration.php
/var/www/wordpress/wp-includes/rewrite.php
/var/www/wordpress/wp-includes/rss-functions.php
/var/www/wordpress/wp-includes/rss.php
/var/www/wordpress/wp-includes/script-loader.php
/var/www/wordpress/wp-includes/shortcodes.php
/var/www/wordpress/wp-includes/taxonomy.php
/var/www/wordpress/wp-includes/template-loader.php
/var/www/wordpress/wp-includes/theme.php
/var/www/wordpress/wp-includes/update.php
/var/www/wordpress/wp-includes/user.php
/var/www/wordpress/wp-includes/vars.php
/var/www/wordpress/wp-includes/version.php
/var/www/wordpress/wp-includes/widgets.php
/var/www/wordpress/wp-includes/wp-db.php
/var/www/wordpress/wp-includes/wp-diff.php
/var/www/wordpress/index.php
/var/www/wordpress/wp-activate.php
/var/www/wordpress/wp-app.php
/var/www/wordpress/wp-atom.php
/var/www/wordpress/wp-blog-header.php
/var/www/wordpress/wp-comments-post.php
/var/www/wordpress/wp-commentsrss2.php
/var/www/wordpress/wp-config-sample.php
/var/www/wordpress/wp-cron.php
/var/www/wordpress/wp-feed.php
/var/www/wordpress/wp-links-opml.php
/var/www/wordpress/wp-load.php
/var/www/wordpress/wp-login.php
/var/www/wordpress/wp-mail.php
/var/www/wordpress/wp-pass.php
/var/www/wordpress/wp-rdf.php
/var/www/wordpress/wp-register.php
/var/www/wordpress/wp-rss.php
/var/www/wordpress/wp-rss2.php
/var/www/wordpress/wp-settings.php
/var/www/wordpress/wp-signup.php
/var/www/wordpress/wp-trackback.php
/var/www/wordpress/xmlrpc.php