whip_wp_check_versions

Facade to quickly check if version requirements are met.

Description

whip_wp_check_versions( (array) $requirements ); 

Parameters (1)

0. $requirements (array)
The requirements to check.

Usage

  1. if ( !function_exists( 'whip_wp_check_versions' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'yoast-seo/vendor/yoast/whip/src/facades/wordpress.php'; 
  3.  
  4. // The requirements to check. 
  5. $requirements = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = whip_wp_check_versions($requirements); 
  9.  

Defined (1)

The function is defined in the following location(s).

/vendor/yoast/whip/src/facades/wordpress.php  
  1. function whip_wp_check_versions( $requirements ) { 
  2. // Only show for admin users. 
  3. if ( ! is_array( $requirements ) ) { 
  4. return; 
  5.  
  6. $config = include dirname( __FILE__ ) . '/../configs/default.php'; 
  7. $checker = new Whip_RequirementsChecker( $config ); 
  8.  
  9. foreach ( $requirements as $component => $versionComparison ) { 
  10. $checker->addRequirement( Whip_VersionRequirement::fromCompareString( $component, $versionComparison ) ); 
  11.  
  12. $checker->check(); 
  13.  
  14. if ( ! $checker->hasMessages() ) { 
  15. return; 
  16.  
  17. $presenter = new Whip_WPMessagePresenter( $checker->getMostRecentMessage() ); 
  18. $presenter->register_hooks();