WP_Site_Health_Auto_Updates::test_accepts_dev_updates() WordPress Method

The WP_Site_Health_Auto_Updates::test_accepts_dev_updates() method is used to test whether the site will accept updates from the development version of WordPress.

WP_Site_Health_Auto_Updates::test_accepts_dev_updates() #

Check if the install is using a development branch and can use nightly packages.


Return

(array|false) The test results. False if it isn't a development version.


Top ↑

Source

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

	public function test_accepts_dev_updates() {
		require ABSPATH . WPINC . '/version.php'; // $wp_version; // x.y.z
		// Only for dev versions.
		if ( false === strpos( $wp_version, '-' ) ) {
			return false;
		}

		if ( defined( 'WP_AUTO_UPDATE_CORE' ) && ( 'minor' === WP_AUTO_UPDATE_CORE || false === WP_AUTO_UPDATE_CORE ) ) {
			return array(
				'description' => sprintf(
					/* translators: %s: Name of the constant used. */
					__( 'WordPress development updates are blocked by the %s constant.' ),
					'<code>WP_AUTO_UPDATE_CORE</code>'
				),
				'severity'    => 'fail',
			);
		}

		/** This filter is documented in wp-admin/includes/class-core-upgrader.php */
		if ( ! apply_filters( 'allow_dev_auto_core_updates', $wp_version ) ) {
			return array(
				'description' => sprintf(
					/* translators: %s: Name of the filter used. */
					__( 'WordPress development updates are blocked by the %s filter.' ),
					'<code>allow_dev_auto_core_updates</code>'
				),
				'severity'    => 'fail',
			);
		}
	}


Top ↑

Changelog

Changelog
VersionDescription
5.2.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.