Uma área de pesquisa sobre o WordPress para devs e autores do tema



_upgrade_cron_array ›

Desde2.1.0
Obsoleton/a
_upgrade_cron_array ( $cron )
Acesso:
  • private
Parâmetros:
  • (array) $cron Cron info array from _get_cron_array().
    Required: Yes
Retorna:
  • (array) An upgraded Cron info array.
Definido em:
Codex:

Upgrade a Cron info array.

This function upgrades the Cron info array to version 2.



Fonte

function _upgrade_cron_array( $cron ) {
	if ( isset( $cron['version'] ) && 2 == $cron['version'] ) {
		return $cron;
	}

	$new_cron = array();

	foreach ( (array) $cron as $timestamp => $hooks ) {
		foreach ( (array) $hooks as $hook => $args ) {
			$key                                     = md5( serialize( $args['args'] ) );
			$new_cron[ $timestamp ][ $hook ][ $key ] = $args;
		}
	}

	$new_cron['version'] = 2;
	update_option( 'cron', $new_cron );
	return $new_cron;
}