Skip to content

Instantly share code, notes, and snippets.

@Shelob9 Shelob9/1.php
Created Jun 27, 2018

Embed
What would you like to do?
<?php
if (!version_compare(PHP_VERSION, '5.6.0', '>=')) {
function slug_php_version_nag()
{
?>
<div class="notice notice-error">
<p>
<?php _e('Your version of PHP is incompatible with YOUR PLUGIN and can not be used.', 'caldera-forms'); ?>
<?php printf(' <a href="https://your-plugin.com/php?utm_source=wp-admin&utm_campaign=php_deprecated&utm_source=admin-nag" target="__blank">%s</a>',
esc_html__('Learn More', 'slug')
) ?></p>
</div>
<?php
}
add_action('admin_notices', 'slug_php_version_nag');
}
=== Your plugin ===
Contributors: Shelob9
Tags: hi-oy
Requires at least: 4.7
Tested up to: 4.9.7
Stable tag: 1.7.2
License: GPLv2
Requires PHP: 5.6
@cliffordp

This comment has been minimized.

Copy link

commented Sep 3, 2018

Hey, Josh. I saw this gist embedded at https://torquemag.io/2018/08/how-to-drop-legacy-php-support-in-wordpress-plugins/

For those who copy/paste without reading first, please change that License to add or any later version -- better yet, GPL version 3 or any later version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.