Summery Summery

Test if auto-updates related constants are set correctly.

Syntax Syntax

WP_Site_Health_Auto_Updates::test_constants( string $constant, bool $value )

Parameters Parameters


(string) (Required) The name of the constant to check.


(bool) (Required) The value that the constant should be, if set.

Return Return

(array) The test results.

Source Source

File: wp-admin/includes/class-wp-site-health-auto-updates.php

	 *                                 or an array of acceptable values.
	 * @return array The test results.
	public function test_constants( $constant, $value ) {
		$acceptable_values = (array) $value;

		if ( defined( $constant ) && ! in_array( constant( $constant ), $acceptable_values, true ) ) {
			return array(
				'description' => sprintf(
					/* translators: %s: Name of the constant used. */
					__( 'The %s constant is defined and enabled.' ),


Changelog Changelog

Version Description
5.2.0 Introduced.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.