WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Самая быстрая Тема-конструктор для WordPress
класс не описан

Automattic\Jetpack\Autoloader\jp02f167abb8e9ed34472e5bd963af3d06

Version_Selector{} WC 1.0

Used to select package versions.

Хуков нет.

Возвращает

Null. Ничего.

Использование

$Version_Selector = new Version_Selector();
// use class methods

Методы

  1. is_package_version_dev( $version )
  2. ERROR: no method name found on line ``
  3. is_package_version_dev( $version )
  4. ERROR: no method name found on line ``
  5. is_package_version_dev( $version )
  6. ERROR: no method name found on line ``
  7. is_version_update_required( $selected_version, $compare_version )
  8. ERROR: no method name found on line ` *`
  9. is_version_update_required( $selected_version, $compare_version )
  10. ERROR: no method name found on line ` *`
  11. is_version_update_required( $selected_version, $compare_version )
  12. ERROR: no method name found on line ` *`

Код Version_Selector{} WC 4.6.1

<?php
class Version_Selector {

	/**
	 * Checks whether the selected package version should be updated. Composer development
	 * package versions ('9999999-dev' or versions that start with 'dev-') are favored
	 * when the JETPACK_AUTOLOAD_DEV constant is set to true.
	 *
	 * @param String $selected_version The currently selected package version.
	 * @param String $compare_version The package version that is being evaluated to
	 *                                determine if the version needs to be updated.
	 *
	 * @return Boolean Returns true if the selected package version should be updated,
	 *                 else false.
	 */
	public function is_version_update_required( $selected_version, $compare_version ) {
		$use_dev_versions = defined( 'JETPACK_AUTOLOAD_DEV' ) && JETPACK_AUTOLOAD_DEV;

		if ( is_null( $selected_version ) ) {
			return true;
		}

		if ( $use_dev_versions && $this->is_package_version_dev( $selected_version ) ) {
			return false;
		}

		if ( $this->is_package_version_dev( $compare_version ) ) {
			if ( $use_dev_versions ) {
				return true;
			} else {
				return false;
			}
		}

		if ( version_compare( $selected_version, $compare_version, '<' ) ) {
			return true;
		}

		return false;
	}

	/**
	 * Checks whether the given package version is a development version.
	 *
	 * @param String $version The package version.
	 *
	 * @return Boolean True if the version is a dev version, else false.
	 */
	private function is_package_version_dev( $version ) {
		if ( 'dev-' === substr( $version, 0, 4 ) || '9999999-dev' === $version ) {
			return true;
		}

		return false;
	}
}