Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu...
File: cron.php
}
[500] Fix | Delete
[501] Fix | Delete
if ( ! $wp_error && is_wp_error( $pre ) ) {
[502] Fix | Delete
return false;
[503] Fix | Delete
}
[504] Fix | Delete
[505] Fix | Delete
return $pre;
[506] Fix | Delete
}
[507] Fix | Delete
[508] Fix | Delete
$crons = _get_cron_array();
[509] Fix | Delete
$key = md5( serialize( $args ) );
[510] Fix | Delete
[511] Fix | Delete
unset( $crons[ $timestamp ][ $hook ][ $key ] );
[512] Fix | Delete
[513] Fix | Delete
if ( empty( $crons[ $timestamp ][ $hook ] ) ) {
[514] Fix | Delete
unset( $crons[ $timestamp ][ $hook ] );
[515] Fix | Delete
}
[516] Fix | Delete
[517] Fix | Delete
if ( empty( $crons[ $timestamp ] ) ) {
[518] Fix | Delete
unset( $crons[ $timestamp ] );
[519] Fix | Delete
}
[520] Fix | Delete
[521] Fix | Delete
return _set_cron_array( $crons, $wp_error );
[522] Fix | Delete
}
[523] Fix | Delete
[524] Fix | Delete
/**
[525] Fix | Delete
* Unschedules all events attached to the hook with the specified arguments.
[526] Fix | Delete
*
[527] Fix | Delete
* Warning: This function may return boolean false, but may also return a non-boolean
[528] Fix | Delete
* value which evaluates to false. For information about casting to booleans see the
[529] Fix | Delete
* {@link https://www.php.net/manual/en/language.types.boolean.php PHP documentation}. Use
[530] Fix | Delete
* the `===` operator for testing the return value of this function.
[531] Fix | Delete
*
[532] Fix | Delete
* @since 2.1.0
[533] Fix | Delete
* @since 5.1.0 Return value modified to indicate success or failure,
[534] Fix | Delete
* {@see 'pre_clear_scheduled_hook'} filter added to short-circuit the function.
[535] Fix | Delete
* @since 5.7.0 The `$wp_error` parameter was added.
[536] Fix | Delete
*
[537] Fix | Delete
* @param string $hook Action hook, the execution of which will be unscheduled.
[538] Fix | Delete
* @param array $args Optional. Array containing each separate argument to pass to the hook's callback function.
[539] Fix | Delete
* Although not passed to a callback, these arguments are used to uniquely identify the
[540] Fix | Delete
* event, so they should be the same as those used when originally scheduling the event.
[541] Fix | Delete
* Default empty array.
[542] Fix | Delete
* @param bool $wp_error Optional. Whether to return a WP_Error on failure. Default false.
[543] Fix | Delete
* @return int|false|WP_Error On success an integer indicating number of events unscheduled (0 indicates no
[544] Fix | Delete
* events were registered with the hook and arguments combination), false or WP_Error
[545] Fix | Delete
* if unscheduling one or more events fail.
[546] Fix | Delete
*/
[547] Fix | Delete
function wp_clear_scheduled_hook( $hook, $args = array(), $wp_error = false ) {
[548] Fix | Delete
/*
[549] Fix | Delete
* Backward compatibility.
[550] Fix | Delete
* Previously, this function took the arguments as discrete vars rather than an array like the rest of the API.
[551] Fix | Delete
*/
[552] Fix | Delete
if ( ! is_array( $args ) ) {
[553] Fix | Delete
_deprecated_argument(
[554] Fix | Delete
__FUNCTION__,
[555] Fix | Delete
'3.0.0',
[556] Fix | Delete
__( 'This argument has changed to an array to match the behavior of the other cron functions.' )
[557] Fix | Delete
);
[558] Fix | Delete
[559] Fix | Delete
$args = array_slice( func_get_args(), 1 ); // phpcs:ignore PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.NeedsInspection
[560] Fix | Delete
$wp_error = false;
[561] Fix | Delete
}
[562] Fix | Delete
[563] Fix | Delete
/**
[564] Fix | Delete
* Filter to override clearing a scheduled hook.
[565] Fix | Delete
*
[566] Fix | Delete
* Returning a non-null value will short-circuit the normal unscheduling
[567] Fix | Delete
* process, causing the function to return the filtered value instead.
[568] Fix | Delete
*
[569] Fix | Delete
* For plugins replacing wp-cron, return the number of events successfully
[570] Fix | Delete
* unscheduled (zero if no events were registered with the hook) or false
[571] Fix | Delete
* or a WP_Error if unscheduling one or more events fails.
[572] Fix | Delete
*
[573] Fix | Delete
* @since 5.1.0
[574] Fix | Delete
* @since 5.7.0 The `$wp_error` parameter was added, and a `WP_Error` object can now be returned.
[575] Fix | Delete
*
[576] Fix | Delete
* @param null|int|false|WP_Error $pre Value to return instead. Default null to continue unscheduling the event.
[577] Fix | Delete
* @param string $hook Action hook, the execution of which will be unscheduled.
[578] Fix | Delete
* @param array $args Arguments to pass to the hook's callback function.
[579] Fix | Delete
* @param bool $wp_error Whether to return a WP_Error on failure.
[580] Fix | Delete
*/
[581] Fix | Delete
$pre = apply_filters( 'pre_clear_scheduled_hook', null, $hook, $args, $wp_error );
[582] Fix | Delete
[583] Fix | Delete
if ( null !== $pre ) {
[584] Fix | Delete
if ( $wp_error && false === $pre ) {
[585] Fix | Delete
return new WP_Error(
[586] Fix | Delete
'pre_clear_scheduled_hook_false',
[587] Fix | Delete
__( 'A plugin prevented the hook from being cleared.' )
[588] Fix | Delete
);
[589] Fix | Delete
}
[590] Fix | Delete
[591] Fix | Delete
if ( ! $wp_error && is_wp_error( $pre ) ) {
[592] Fix | Delete
return false;
[593] Fix | Delete
}
[594] Fix | Delete
[595] Fix | Delete
return $pre;
[596] Fix | Delete
}
[597] Fix | Delete
[598] Fix | Delete
/*
[599] Fix | Delete
* This logic duplicates wp_next_scheduled().
[600] Fix | Delete
* It's required due to a scenario where wp_unschedule_event() fails due to update_option() failing,
[601] Fix | Delete
* and, wp_next_scheduled() returns the same schedule in an infinite loop.
[602] Fix | Delete
*/
[603] Fix | Delete
$crons = _get_cron_array();
[604] Fix | Delete
if ( empty( $crons ) ) {
[605] Fix | Delete
return 0;
[606] Fix | Delete
}
[607] Fix | Delete
[608] Fix | Delete
$results = array();
[609] Fix | Delete
$key = md5( serialize( $args ) );
[610] Fix | Delete
[611] Fix | Delete
foreach ( $crons as $timestamp => $cron ) {
[612] Fix | Delete
if ( isset( $cron[ $hook ][ $key ] ) ) {
[613] Fix | Delete
$results[] = wp_unschedule_event( $timestamp, $hook, $args, true );
[614] Fix | Delete
}
[615] Fix | Delete
}
[616] Fix | Delete
[617] Fix | Delete
$errors = array_filter( $results, 'is_wp_error' );
[618] Fix | Delete
$error = new WP_Error();
[619] Fix | Delete
[620] Fix | Delete
if ( $errors ) {
[621] Fix | Delete
if ( $wp_error ) {
[622] Fix | Delete
array_walk( $errors, array( $error, 'merge_from' ) );
[623] Fix | Delete
[624] Fix | Delete
return $error;
[625] Fix | Delete
}
[626] Fix | Delete
[627] Fix | Delete
return false;
[628] Fix | Delete
}
[629] Fix | Delete
[630] Fix | Delete
return count( $results );
[631] Fix | Delete
}
[632] Fix | Delete
[633] Fix | Delete
/**
[634] Fix | Delete
* Unschedules all events attached to the hook.
[635] Fix | Delete
*
[636] Fix | Delete
* Can be useful for plugins when deactivating to clean up the cron queue.
[637] Fix | Delete
*
[638] Fix | Delete
* Warning: This function may return boolean false, but may also return a non-boolean
[639] Fix | Delete
* value which evaluates to false. For information about casting to booleans see the
[640] Fix | Delete
* {@link https://www.php.net/manual/en/language.types.boolean.php PHP documentation}. Use
[641] Fix | Delete
* the `===` operator for testing the return value of this function.
[642] Fix | Delete
*
[643] Fix | Delete
* @since 4.9.0
[644] Fix | Delete
* @since 5.1.0 Return value added to indicate success or failure.
[645] Fix | Delete
* @since 5.7.0 The `$wp_error` parameter was added.
[646] Fix | Delete
*
[647] Fix | Delete
* @param string $hook Action hook, the execution of which will be unscheduled.
[648] Fix | Delete
* @param bool $wp_error Optional. Whether to return a WP_Error on failure. Default false.
[649] Fix | Delete
* @return int|false|WP_Error On success an integer indicating number of events unscheduled (0 indicates no
[650] Fix | Delete
* events were registered on the hook), false or WP_Error if unscheduling fails.
[651] Fix | Delete
*/
[652] Fix | Delete
function wp_unschedule_hook( $hook, $wp_error = false ) {
[653] Fix | Delete
/**
[654] Fix | Delete
* Filter to override clearing all events attached to the hook.
[655] Fix | Delete
*
[656] Fix | Delete
* Returning a non-null value will short-circuit the normal unscheduling
[657] Fix | Delete
* process, causing the function to return the filtered value instead.
[658] Fix | Delete
*
[659] Fix | Delete
* For plugins replacing wp-cron, return the number of events successfully
[660] Fix | Delete
* unscheduled (zero if no events were registered with the hook). If unscheduling
[661] Fix | Delete
* one or more events fails then return either a WP_Error object or false depending
[662] Fix | Delete
* on the value of the `$wp_error` parameter.
[663] Fix | Delete
*
[664] Fix | Delete
* @since 5.1.0
[665] Fix | Delete
* @since 5.7.0 The `$wp_error` parameter was added, and a `WP_Error` object can now be returned.
[666] Fix | Delete
*
[667] Fix | Delete
* @param null|int|false|WP_Error $pre Value to return instead. Default null to continue unscheduling the hook.
[668] Fix | Delete
* @param string $hook Action hook, the execution of which will be unscheduled.
[669] Fix | Delete
* @param bool $wp_error Whether to return a WP_Error on failure.
[670] Fix | Delete
*/
[671] Fix | Delete
$pre = apply_filters( 'pre_unschedule_hook', null, $hook, $wp_error );
[672] Fix | Delete
[673] Fix | Delete
if ( null !== $pre ) {
[674] Fix | Delete
if ( $wp_error && false === $pre ) {
[675] Fix | Delete
return new WP_Error(
[676] Fix | Delete
'pre_unschedule_hook_false',
[677] Fix | Delete
__( 'A plugin prevented the hook from being cleared.' )
[678] Fix | Delete
);
[679] Fix | Delete
}
[680] Fix | Delete
[681] Fix | Delete
if ( ! $wp_error && is_wp_error( $pre ) ) {
[682] Fix | Delete
return false;
[683] Fix | Delete
}
[684] Fix | Delete
[685] Fix | Delete
return $pre;
[686] Fix | Delete
}
[687] Fix | Delete
[688] Fix | Delete
$crons = _get_cron_array();
[689] Fix | Delete
if ( empty( $crons ) ) {
[690] Fix | Delete
return 0;
[691] Fix | Delete
}
[692] Fix | Delete
[693] Fix | Delete
$results = array();
[694] Fix | Delete
[695] Fix | Delete
foreach ( $crons as $timestamp => $args ) {
[696] Fix | Delete
if ( ! empty( $crons[ $timestamp ][ $hook ] ) ) {
[697] Fix | Delete
$results[] = count( $crons[ $timestamp ][ $hook ] );
[698] Fix | Delete
}
[699] Fix | Delete
[700] Fix | Delete
unset( $crons[ $timestamp ][ $hook ] );
[701] Fix | Delete
[702] Fix | Delete
if ( empty( $crons[ $timestamp ] ) ) {
[703] Fix | Delete
unset( $crons[ $timestamp ] );
[704] Fix | Delete
}
[705] Fix | Delete
}
[706] Fix | Delete
[707] Fix | Delete
/*
[708] Fix | Delete
* If the results are empty (zero events to unschedule), no attempt
[709] Fix | Delete
* to update the cron array is required.
[710] Fix | Delete
*/
[711] Fix | Delete
if ( empty( $results ) ) {
[712] Fix | Delete
return 0;
[713] Fix | Delete
}
[714] Fix | Delete
[715] Fix | Delete
$set = _set_cron_array( $crons, $wp_error );
[716] Fix | Delete
[717] Fix | Delete
if ( true === $set ) {
[718] Fix | Delete
return array_sum( $results );
[719] Fix | Delete
}
[720] Fix | Delete
[721] Fix | Delete
return $set;
[722] Fix | Delete
}
[723] Fix | Delete
[724] Fix | Delete
/**
[725] Fix | Delete
* Retrieves a scheduled event.
[726] Fix | Delete
*
[727] Fix | Delete
* Retrieves the full event object for a given event, if no timestamp is specified the next
[728] Fix | Delete
* scheduled event is returned.
[729] Fix | Delete
*
[730] Fix | Delete
* @since 5.1.0
[731] Fix | Delete
*
[732] Fix | Delete
* @param string $hook Action hook of the event.
[733] Fix | Delete
* @param array $args Optional. Array containing each separate argument to pass to the hook's callback function.
[734] Fix | Delete
* Although not passed to a callback, these arguments are used to uniquely identify the
[735] Fix | Delete
* event, so they should be the same as those used when originally scheduling the event.
[736] Fix | Delete
* Default empty array.
[737] Fix | Delete
* @param int|null $timestamp Optional. Unix timestamp (UTC) of the event. If not specified, the next scheduled event
[738] Fix | Delete
* is returned. Default null.
[739] Fix | Delete
* @return object|false {
[740] Fix | Delete
* The event object. False if the event does not exist.
[741] Fix | Delete
*
[742] Fix | Delete
* @type string $hook Action hook to execute when the event is run.
[743] Fix | Delete
* @type int $timestamp Unix timestamp (UTC) for when to next run the event.
[744] Fix | Delete
* @type string|false $schedule How often the event should subsequently recur.
[745] Fix | Delete
* @type array $args Array containing each separate argument to pass to the hook's callback function.
[746] Fix | Delete
* @type int $interval Optional. The interval time in seconds for the schedule. Only present for recurring events.
[747] Fix | Delete
* }
[748] Fix | Delete
*/
[749] Fix | Delete
function wp_get_scheduled_event( $hook, $args = array(), $timestamp = null ) {
[750] Fix | Delete
/**
[751] Fix | Delete
* Filter to override retrieving a scheduled event.
[752] Fix | Delete
*
[753] Fix | Delete
* Returning a non-null value will short-circuit the normal process,
[754] Fix | Delete
* returning the filtered value instead.
[755] Fix | Delete
*
[756] Fix | Delete
* Return false if the event does not exist, otherwise an event object
[757] Fix | Delete
* should be returned.
[758] Fix | Delete
*
[759] Fix | Delete
* @since 5.1.0
[760] Fix | Delete
*
[761] Fix | Delete
* @param null|false|object $pre Value to return instead. Default null to continue retrieving the event.
[762] Fix | Delete
* @param string $hook Action hook of the event.
[763] Fix | Delete
* @param array $args Array containing each separate argument to pass to the hook's callback function.
[764] Fix | Delete
* Although not passed to a callback, these arguments are used to uniquely identify
[765] Fix | Delete
* the event.
[766] Fix | Delete
* @param int|null $timestamp Unix timestamp (UTC) of the event. Null to retrieve next scheduled event.
[767] Fix | Delete
*/
[768] Fix | Delete
$pre = apply_filters( 'pre_get_scheduled_event', null, $hook, $args, $timestamp );
[769] Fix | Delete
[770] Fix | Delete
if ( null !== $pre ) {
[771] Fix | Delete
return $pre;
[772] Fix | Delete
}
[773] Fix | Delete
[774] Fix | Delete
if ( null !== $timestamp && ! is_numeric( $timestamp ) ) {
[775] Fix | Delete
return false;
[776] Fix | Delete
}
[777] Fix | Delete
[778] Fix | Delete
$crons = _get_cron_array();
[779] Fix | Delete
if ( empty( $crons ) ) {
[780] Fix | Delete
return false;
[781] Fix | Delete
}
[782] Fix | Delete
[783] Fix | Delete
$key = md5( serialize( $args ) );
[784] Fix | Delete
[785] Fix | Delete
if ( ! $timestamp ) {
[786] Fix | Delete
// Get next event.
[787] Fix | Delete
$next = false;
[788] Fix | Delete
foreach ( $crons as $timestamp => $cron ) {
[789] Fix | Delete
if ( isset( $cron[ $hook ][ $key ] ) ) {
[790] Fix | Delete
$next = $timestamp;
[791] Fix | Delete
break;
[792] Fix | Delete
}
[793] Fix | Delete
}
[794] Fix | Delete
[795] Fix | Delete
if ( ! $next ) {
[796] Fix | Delete
return false;
[797] Fix | Delete
}
[798] Fix | Delete
[799] Fix | Delete
$timestamp = $next;
[800] Fix | Delete
} elseif ( ! isset( $crons[ $timestamp ][ $hook ][ $key ] ) ) {
[801] Fix | Delete
return false;
[802] Fix | Delete
}
[803] Fix | Delete
[804] Fix | Delete
$event = (object) array(
[805] Fix | Delete
'hook' => $hook,
[806] Fix | Delete
'timestamp' => $timestamp,
[807] Fix | Delete
'schedule' => $crons[ $timestamp ][ $hook ][ $key ]['schedule'],
[808] Fix | Delete
'args' => $args,
[809] Fix | Delete
);
[810] Fix | Delete
[811] Fix | Delete
if ( isset( $crons[ $timestamp ][ $hook ][ $key ]['interval'] ) ) {
[812] Fix | Delete
$event->interval = $crons[ $timestamp ][ $hook ][ $key ]['interval'];
[813] Fix | Delete
}
[814] Fix | Delete
[815] Fix | Delete
return $event;
[816] Fix | Delete
}
[817] Fix | Delete
[818] Fix | Delete
/**
[819] Fix | Delete
* Retrieves the next timestamp for an event.
[820] Fix | Delete
*
[821] Fix | Delete
* @since 2.1.0
[822] Fix | Delete
*
[823] Fix | Delete
* @param string $hook Action hook of the event.
[824] Fix | Delete
* @param array $args Optional. Array containing each separate argument to pass to the hook's callback function.
[825] Fix | Delete
* Although not passed to a callback, these arguments are used to uniquely identify the
[826] Fix | Delete
* event, so they should be the same as those used when originally scheduling the event.
[827] Fix | Delete
* Default empty array.
[828] Fix | Delete
* @return int|false The Unix timestamp of the next time the event will occur. False if the event doesn't exist.
[829] Fix | Delete
*/
[830] Fix | Delete
function wp_next_scheduled( $hook, $args = array() ) {
[831] Fix | Delete
$next_event = wp_get_scheduled_event( $hook, $args );
[832] Fix | Delete
[833] Fix | Delete
if ( ! $next_event ) {
[834] Fix | Delete
return false;
[835] Fix | Delete
}
[836] Fix | Delete
[837] Fix | Delete
return $next_event->timestamp;
[838] Fix | Delete
}
[839] Fix | Delete
[840] Fix | Delete
/**
[841] Fix | Delete
* Sends a request to run cron through HTTP request that doesn't halt page loading.
[842] Fix | Delete
*
[843] Fix | Delete
* @since 2.1.0
[844] Fix | Delete
* @since 5.1.0 Return values added.
[845] Fix | Delete
*
[846] Fix | Delete
* @param int $gmt_time Optional. Unix timestamp (UTC). Default 0 (current time is used).
[847] Fix | Delete
* @return bool True if spawned, false if no events spawned.
[848] Fix | Delete
*/
[849] Fix | Delete
function spawn_cron( $gmt_time = 0 ) {
[850] Fix | Delete
if ( ! $gmt_time ) {
[851] Fix | Delete
$gmt_time = microtime( true );
[852] Fix | Delete
}
[853] Fix | Delete
[854] Fix | Delete
if ( defined( 'DOING_CRON' ) || isset( $_GET['doing_wp_cron'] ) ) {
[855] Fix | Delete
return false;
[856] Fix | Delete
}
[857] Fix | Delete
[858] Fix | Delete
/*
[859] Fix | Delete
* Get the cron lock, which is a Unix timestamp of when the last cron was spawned
[860] Fix | Delete
* and has not finished running.
[861] Fix | Delete
*
[862] Fix | Delete
* Multiple processes on multiple web servers can run this code concurrently,
[863] Fix | Delete
* this lock attempts to make spawning as atomic as possible.
[864] Fix | Delete
*/
[865] Fix | Delete
$lock = (float) get_transient( 'doing_cron' );
[866] Fix | Delete
[867] Fix | Delete
if ( $lock > $gmt_time + 10 * MINUTE_IN_SECONDS ) {
[868] Fix | Delete
$lock = 0;
[869] Fix | Delete
}
[870] Fix | Delete
[871] Fix | Delete
// Don't run if another process is currently running it or more than once every 60 sec.
[872] Fix | Delete
if ( $lock + WP_CRON_LOCK_TIMEOUT > $gmt_time ) {
[873] Fix | Delete
return false;
[874] Fix | Delete
}
[875] Fix | Delete
[876] Fix | Delete
// Confidence check.
[877] Fix | Delete
$crons = wp_get_ready_cron_jobs();
[878] Fix | Delete
if ( empty( $crons ) ) {
[879] Fix | Delete
return false;
[880] Fix | Delete
}
[881] Fix | Delete
[882] Fix | Delete
$keys = array_keys( $crons );
[883] Fix | Delete
if ( isset( $keys[0] ) && $keys[0] > $gmt_time ) {
[884] Fix | Delete
return false;
[885] Fix | Delete
}
[886] Fix | Delete
[887] Fix | Delete
if ( defined( 'ALTERNATE_WP_CRON' ) && ALTERNATE_WP_CRON ) {
[888] Fix | Delete
if ( 'GET' !== $_SERVER['REQUEST_METHOD'] || defined( 'DOING_AJAX' ) || defined( 'XMLRPC_REQUEST' ) ) {
[889] Fix | Delete
return false;
[890] Fix | Delete
}
[891] Fix | Delete
[892] Fix | Delete
$doing_wp_cron = sprintf( '%.22F', $gmt_time );
[893] Fix | Delete
set_transient( 'doing_cron', $doing_wp_cron );
[894] Fix | Delete
[895] Fix | Delete
ob_start();
[896] Fix | Delete
wp_redirect( add_query_arg( 'doing_wp_cron', $doing_wp_cron, wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
[897] Fix | Delete
echo ' ';
[898] Fix | Delete
[899] Fix | Delete
// Flush any buffers and send the headers.
[900] Fix | Delete
wp_ob_end_flush_all();
[901] Fix | Delete
flush();
[902] Fix | Delete
[903] Fix | Delete
require_once ABSPATH . 'wp-cron.php';
[904] Fix | Delete
return true;
[905] Fix | Delete
}
[906] Fix | Delete
[907] Fix | Delete
// Set the cron lock with the current unix timestamp, when the cron is being spawned.
[908] Fix | Delete
$doing_wp_cron = sprintf( '%.22F', $gmt_time );
[909] Fix | Delete
set_transient( 'doing_cron', $doing_wp_cron );
[910] Fix | Delete
[911] Fix | Delete
/**
[912] Fix | Delete
* Filters the cron request arguments.
[913] Fix | Delete
*
[914] Fix | Delete
* @since 3.5.0
[915] Fix | Delete
* @since 4.5.0 The `$doing_wp_cron` parameter was added.
[916] Fix | Delete
*
[917] Fix | Delete
* @param array $cron_request_array {
[918] Fix | Delete
* An array of cron request URL arguments.
[919] Fix | Delete
*
[920] Fix | Delete
* @type string $url The cron request URL.
[921] Fix | Delete
* @type int $key The 22 digit GMT microtime.
[922] Fix | Delete
* @type array $args {
[923] Fix | Delete
* An array of cron request arguments.
[924] Fix | Delete
*
[925] Fix | Delete
* @type int $timeout The request timeout in seconds. Default .01 seconds.
[926] Fix | Delete
* @type bool $blocking Whether to set blocking for the request. Default false.
[927] Fix | Delete
* @type bool $sslverify Whether SSL should be verified for the request. Default false.
[928] Fix | Delete
* }
[929] Fix | Delete
* }
[930] Fix | Delete
* @param string $doing_wp_cron The unix timestamp of the cron lock.
[931] Fix | Delete
*/
[932] Fix | Delete
$cron_request = apply_filters(
[933] Fix | Delete
'cron_request',
[934] Fix | Delete
array(
[935] Fix | Delete
'url' => add_query_arg( 'doing_wp_cron', $doing_wp_cron, site_url( 'wp-cron.php' ) ),
[936] Fix | Delete
'key' => $doing_wp_cron,
[937] Fix | Delete
'args' => array(
[938] Fix | Delete
'timeout' => 0.01,
[939] Fix | Delete
'blocking' => false,
[940] Fix | Delete
/** This filter is documented in wp-includes/class-wp-http-streams.php */
[941] Fix | Delete
'sslverify' => apply_filters( 'https_local_ssl_verify', false ),
[942] Fix | Delete
),
[943] Fix | Delete
),
[944] Fix | Delete
$doing_wp_cron
[945] Fix | Delete
);
[946] Fix | Delete
[947] Fix | Delete
$result = wp_remote_post( $cron_request['url'], $cron_request['args'] );
[948] Fix | Delete
[949] Fix | Delete
return ! is_wp_error( $result );
[950] Fix | Delete
}
[951] Fix | Delete
[952] Fix | Delete
/**
[953] Fix | Delete
* Registers _wp_cron() to run on the {@see 'wp_loaded'} action.
[954] Fix | Delete
*
[955] Fix | Delete
* If the {@see 'wp_loaded'} action has already fired, this function calls
[956] Fix | Delete
* _wp_cron() directly.
[957] Fix | Delete
*
[958] Fix | Delete
* Warning: This function may return Boolean FALSE, but may also return a non-Boolean
[959] Fix | Delete
* value which evaluates to FALSE. For information about casting to booleans see the
[960] Fix | Delete
* {@link https://www.php.net/manual/en/language.types.boolean.php PHP documentation}. Use
[961] Fix | Delete
* the `===` operator for testing the return value of this function.
[962] Fix | Delete
*
[963] Fix | Delete
* @since 2.1.0
[964] Fix | Delete
* @since 5.1.0 Return value added to indicate success or failure.
[965] Fix | Delete
* @since 5.7.0 Functionality moved to _wp_cron() to which this becomes a wrapper.
[966] Fix | Delete
*
[967] Fix | Delete
* @return false|int|void On success an integer indicating number of events spawned (0 indicates no
[968] Fix | Delete
* events needed to be spawned), false if spawning fails for one or more events or
[969] Fix | Delete
* void if the function registered _wp_cron() to run on the action.
[970] Fix | Delete
*/
[971] Fix | Delete
function wp_cron() {
[972] Fix | Delete
if ( did_action( 'wp_loaded' ) ) {
[973] Fix | Delete
return _wp_cron();
[974] Fix | Delete
}
[975] Fix | Delete
[976] Fix | Delete
add_action( 'wp_loaded', '_wp_cron', 20 );
[977] Fix | Delete
}
[978] Fix | Delete
[979] Fix | Delete
/**
[980] Fix | Delete
* Runs scheduled callbacks or spawns cron for all scheduled events.
[981] Fix | Delete
*
[982] Fix | Delete
* Warning: This function may return Boolean FALSE, but may also return a non-Boolean
[983] Fix | Delete
* value which evaluates to FALSE. For information about casting to booleans see the
[984] Fix | Delete
* {@link https://www.php.net/manual/en/language.types.boolean.php PHP documentation}. Use
[985] Fix | Delete
* the `===` operator for testing the return value of this function.
[986] Fix | Delete
*
[987] Fix | Delete
* @since 5.7.0
[988] Fix | Delete
* @access private
[989] Fix | Delete
*
[990] Fix | Delete
* @return int|false On success an integer indicating number of events spawned (0 indicates no
[991] Fix | Delete
* events needed to be spawned), false if spawning fails for one or more events.
[992] Fix | Delete
*/
[993] Fix | Delete
function _wp_cron() {
[994] Fix | Delete
// Prevent infinite loops caused by lack of wp-cron.php.
[995] Fix | Delete
if ( str_contains( $_SERVER['REQUEST_URI'], '/wp-cron.php' )
[996] Fix | Delete
|| ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON )
[997] Fix | Delete
) {
[998] Fix | Delete
return 0;
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function