https://github.com/themeplate/compatibility
https://github.com/themeplate/compatibility
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/themeplate/compatibility
- Owner: ThemePlate
- License: gpl-3.0
- Created: 2023-01-25T15:41:43.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-07T04:45:29.000Z (over 1 year ago)
- Last Synced: 2025-03-07T05:27:15.276Z (over 1 year ago)
- Language: PHP
- Size: 33.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ThemePlate Compatibility
## Usage
```php
use ThemePlate\Compatibility;
( new Compatibility( '6.0', '8.0' ) )->setup( 'My Project' );
```
### Custom messages
```php
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' ) );
```