themeplate / compatibility
Simple compatibility helper class
v0.3.0
2024-03-24 03:50 UTC
Requires
- php: ^7.4|^8.2
Requires (Dev)
- themeplate/tester: ^2.0
- wp-cli/wp-cli: ^2.7
This package is auto-updated.
Last update: 2024-10-24 05:21:01 UTC
README
Usage
use ThemePlate\Compatibility; ( new Compatibility( '6.0', '8.0' ) )->setup( 'My Project' );
Custom messages
use ThemePlate\Compatibility; $compatibility = new Compatibility( '5.0', '5.6' ); /* translators: %s package name */ $compatibility->message_header( 'Sorry! %s is not compatible.' ); /* translators: 1. required version, 2. installed version */ $compatibility->message_wp( __( 'Requires WP %1$s or higher but currently running at %2$s', 'custom_domain' ) ); /* translators: 1. required version, 2. installed version */ $compatibility->message_php( __( 'Requires PHP %1$s or higher but currently running at %2$s', 'custom_domain' ) );