Make WordPress Core


Ignore:
Timestamp:
01/29/2020 12:43:23 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve inline comments per the documentation standards.

Includes minor code layout fixes for better readability.

See #48303.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/cron.php

    r47088 r47122  
    3333 */
    3434function wp_schedule_single_event( $timestamp, $hook, $args = array() ) {
    35     // Make sure timestamp is a positive integer
     35    // Make sure timestamp is a positive integer.
    3636    if ( ! is_numeric( $timestamp ) || $timestamp <= 0 ) {
    3737        return false;
     
    143143    $event = apply_filters( 'schedule_event', $event );
    144144
    145     // A plugin disallowed this event
     145    // A plugin disallowed this event.
    146146    if ( ! $event ) {
    147147        return false;
     
    187187 */
    188188function wp_schedule_event( $timestamp, $recurrence, $hook, $args = array() ) {
    189     // Make sure timestamp is a positive integer
     189    // Make sure timestamp is a positive integer.
    190190    if ( ! is_numeric( $timestamp ) || $timestamp <= 0 ) {
    191191        return false;
     
    215215    $event = apply_filters( 'schedule_event', $event );
    216216
    217     // A plugin disallowed this event
     217    // A plugin disallowed this event.
    218218    if ( ! $event ) {
    219219        return false;
     
    252252 */
    253253function wp_reschedule_event( $timestamp, $recurrence, $hook, $args = array() ) {
    254     // Make sure timestamp is a positive integer
     254    // Make sure timestamp is a positive integer.
    255255    if ( ! is_numeric( $timestamp ) || $timestamp <= 0 ) {
    256256        return false;
     
    308308    }
    309309
    310     // Now we assume something is wrong and fail to schedule
     310    // Now we assume something is wrong and fail to schedule.
    311311    if ( 0 == $interval ) {
    312312        return false;
     
    342342 */
    343343function wp_unschedule_event( $timestamp, $hook, $args = array() ) {
    344     // Make sure timestamp is a positive integer
     344    // Make sure timestamp is a positive integer.
    345345    if ( ! is_numeric( $timestamp ) || $timestamp <= 0 ) {
    346346        return false;
     
    399399 */
    400400function wp_clear_scheduled_hook( $hook, $args = array() ) {
    401     // Backward compatibility
    402     // Previously this function took the arguments as discrete vars rather than an array like the rest of the API
     401    // Backward compatibility.
     402    // Previously, this function took the arguments as discrete vars rather than an array like the rest of the API.
    403403    if ( ! is_array( $args ) ) {
    404404        _deprecated_argument( __FUNCTION__, '3.0.0', __( 'This argument has changed to an array to match the behavior of the other cron functions.' ) );
     
    427427    }
    428428
    429     // This logic duplicates wp_next_scheduled()
    430     // It's required due to a scenario where wp_unschedule_event() fails due to update_option() failing,
    431     // and, wp_next_scheduled() returns the same schedule in an infinite loop.
     429    /*
     430     * This logic duplicates wp_next_scheduled().
     431     * It's required due to a scenario where wp_unschedule_event() fails due to update_option() failing,
     432     * and, wp_next_scheduled() returns the same schedule in an infinite loop.
     433     */
    432434    $crons = _get_cron_array();
    433435    if ( empty( $crons ) ) {
     
    649651    }
    650652
    651     // don't run if another process is currently running it or more than once every 60 sec.
     653    // Don't run if another process is currently running it or more than once every 60 sec.
    652654    if ( $lock + WP_CRON_LOCK_TIMEOUT > $gmt_time ) {
    653655        return false;
    654656    }
    655657
    656     //sanity check
     658    // Sanity check.
    657659    $crons = wp_get_ready_cron_jobs();
    658660    if ( empty( $crons ) ) {
     
    677679        echo ' ';
    678680
    679         // flush any buffers and send the headers
     681        // Flush any buffers and send the headers.
    680682        wp_ob_end_flush_all();
    681683        flush();
     
    744746 */
    745747function wp_cron() {
    746     // Prevent infinite loops caused by lack of wp-cron.php
     748    // Prevent infinite loops caused by lack of wp-cron.php.
    747749    if ( strpos( $_SERVER['REQUEST_URI'], '/wp-cron.php' ) !== false || ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) ) {
    748750        return 0;
     
    924926
    925927//
    926 // Private functions
     928// Private functions.
    927929//
    928930
Note: See TracChangeset for help on using the changeset viewer.