Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin notices not translatable #123

Open
IanDelMar opened this issue Apr 21, 2024 · 0 comments
Open

Admin notices not translatable #123

IanDelMar opened this issue Apr 21, 2024 · 0 comments

Comments

@IanDelMar
Copy link

add_action('admin_notices', function () {
$settings = wpcf7cf_get_settings();
$nid = 'install-cf7';
if ( !defined('WPCF7_VERSION') ) {
if ( current_user_can('update_plugins') ) {
?>
<div class="wpcf7cf-admin-notice notice notice-warning" data-notice-id="<?php echo $nid ?>">
<p>
<strong>Conditional Fields for Contact Form 7</strong> depends on Contact Form 7. Please install <a target="_blank" href="https://downloads.wordpress.org/plugin/contact-form-7.<?php echo WPCF7CF_CF7_MAX_VERSION ?>.zip">Contact Form 7</a>.
</p>
</div>
<?php
}
return;
}
$nid = 'rollback-cf7-'.WPCF7CF_CF7_MAX_VERSION;
if ( version_compare( WPCF7CF_CF7_MAX_VERSION, WPCF7_VERSION, '<' ) && empty($settings['notice_dismissed_'.$nid]) && current_user_can('update_plugins') ) {
?>
<div class="wpcf7cf-admin-notice notice notice-warning is-dismissible" data-notice-id="<?php echo $nid ?>" data-nonce="<?php echo wpcf7cf_get_dismiss_notice_nonce() ?>">
<p>
<strong>Conditional Fields for Contact Form 7</strong> is not yet tested with your current version of Contact Form 7.
<br>If you notice any problems with your forms, please roll back to Contact Form 7 <strong>version <?php echo WPCF7CF_CF7_MAX_VERSION ?></strong>.
<br>For a quick and safe rollback, we recommend <a href="https://wordpress.org/plugins/wp-rollback/" target="_blank">WP Rollback</a>.
</p>
</div>
<?php
}
$nid = 'update-cf7-'.WPCF7CF_CF7_MAX_VERSION;
if ( version_compare( WPCF7CF_CF7_MAX_VERSION, WPCF7_VERSION, '>' ) && empty($settings['notice_dismissed_'.$nid]) && current_user_can('update_plugins') ) {
?>
<div class="wpcf7cf-admin-notice notice notice-warning is-dismissible" data-notice-id="<?php echo $nid ?>" data-nonce="<?php echo wpcf7cf_get_dismiss_notice_nonce() ?>">
<p>
<strong>Conditional Fields for Contact Form 7</strong> is fully compatible and tested with Contact Form 7 version <?php echo WPCF7CF_CF7_MAX_VERSION ?>.
<br>Compatibility with other versions of CF7 is not guaranteed, so please install <a target="_blank" href="https://downloads.wordpress.org/plugin/contact-form-7.<?php echo WPCF7CF_CF7_MAX_VERSION ?>.zip">CF7 version <?php echo WPCF7CF_CF7_MAX_VERSION ?></a>
</p>
</div>
<?php
}
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant