Automattic\WooCommerce\Internal\Admin

SystemStatusReport::render_daily_cron()publicWC 1.0

Render daily cron row.

Method of the class: SystemStatusReport{}

No Hooks.

Return

null. Nothing.

Usage

$SystemStatusReport = new SystemStatusReport();
$SystemStatusReport->render_daily_cron();

SystemStatusReport::render_daily_cron() code WC 7.1.1

<?php
public function render_daily_cron() {
	$next_daily_cron = wp_next_scheduled( 'wc_admin_daily' );
	?>
		<tr>
			<td data-export-label="Daily Cron">
				<?php esc_html_e( 'Daily Cron', 'woocommerce' ); ?>:
			</td>
			<td class="help"><?php echo wc_help_tip( esc_html__( 'Is the daily cron job active, when does it next run?', 'woocommerce' ) ); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?></td>
			<td>
				<?php
				if ( empty( $next_daily_cron ) ) {
					echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . esc_html__( 'Not scheduled', 'woocommerce' ) . '</mark>';
				} else {
					echo '<mark class="yes"><span class="dashicons dashicons-yes"></span> Next scheduled: ' . esc_html( date_i18n( 'Y-m-d H:i:s P', $next_daily_cron ) ) . '</mark>';
				}
				?>
			</td>
		</tr>
	<?php
}