PHP Class Cron_Command, wp-cli

## EXAMPLES # Test WP Cron spawning system $ wp cron test Success: WP-Cron spawning is working as expected.
Inheritance: extends WP_CLI_Command
ファイルを表示 Open project: wp-cli/wp-cli

Public Methods

Method Description
test ( ) Test the WP Cron spawning system and report back its status.

Protected Methods

Method Description
get_cron_spawn ( ) : WP_Error | array Spawn a request to wp-cron.php and return the response.

Method Details

get_cron_spawn() protected static method

This function is designed to mimic the functionality in spawn_cron() with the addition of returning the result of the wp_remote_post() request.
protected static get_cron_spawn ( ) : WP_Error | array
return WP_Error | array The response or WP_Error on failure.

test() public method

This command tests the spawning system by performing the following steps: * Checks to see if the DISABLE_WP_CRON constant is set; errors if true because WP-Cron is disabled. * Checks to see if the ALTERNATE_WP_CRON constant is set; warns if true. * Attempts to spawn WP-Cron over HTTP; warns if non 200 response code is returned. ## EXAMPLES # Cron test runs successfully. $ wp cron test Success: WP-Cron spawning is working as expected.
public test ( )