mirror of
https://ghproxy.net/https://github.com/elementor/wp2static.git
synced 2025-08-29 08:32:23 +08:00
WPML/Polylang/Woo cases
This commit is contained in:
parent
1067db266c
commit
2696802564
1 changed files with 49 additions and 0 deletions
|
@ -135,6 +135,31 @@ class AdminNotices {
|
|||
} else {
|
||||
$notice = array_merge( self::getNoticeContents( 'contact-form-7' ), $notice );
|
||||
}
|
||||
// if both are active, prioritise showing message for WPML
|
||||
} elseif ( ! self::noticeAlreadyDismissed( 'multilingual-plugin-activated' ) &&
|
||||
( is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' ) ||
|
||||
is_plugin_active( 'polylang/polylang.php' ) )
|
||||
) {
|
||||
$notice['name'] = 'multilingual-plugin-activated';
|
||||
|
||||
if ( is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' ) ) {
|
||||
$notice = array_merge( self::getNoticeContents( 'wpml' ), $notice );
|
||||
} else {
|
||||
$notice = array_merge( self::getNoticeContents( 'polylang' ), $notice );
|
||||
}
|
||||
} elseif ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
|
||||
// if at least one WooCommerce order exists, don't show any notices
|
||||
global $wpdb;
|
||||
$woocommerce_orders = $wpdb->get_results(
|
||||
$wpdb->prepare(
|
||||
"SELECT count(*) FROM $wpdb->posts WHERE post_status = %s",
|
||||
'shop_order'
|
||||
)
|
||||
);
|
||||
|
||||
if ( $woocommerce_orders ) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
// if no other notices to be shown, fall back to this generic one
|
||||
$notice = array_merge( self::getNoticeContents( 'generic' ), $notice );
|
||||
|
@ -212,6 +237,30 @@ class AdminNotices {
|
|||
'secondary_button_url' => 'https://www.strattic.com/static-tools/?utm_campaign=learn-more&utm_source=wp2static&utm_medium=wp-dash&utm_term=plugin-form&utm_content=wp-notification-banner',
|
||||
];
|
||||
break;
|
||||
case 'wpml':
|
||||
$notice_contents = [
|
||||
'title' =>
|
||||
'Create dynamic, multi-lingual static websites using Strattic by Elementor!',
|
||||
// phpcs:disable Generic.Files.LineLength.MaxExceeded
|
||||
'message' => 'Strattic by Elementor lets you use WPML on your static site, without implementing any extra configurations. Get 14 days for free. No credit card required!',
|
||||
// phpcs:disable Generic.Files.LineLength.MaxExceeded
|
||||
'primary_button_url' => 'https://www.strattic.com/pricing/?utm_campaign=start-trial&utm_source=wp2static&utm_medium=wp-dash&utm_term=multilingual&utm_content=wp-notification-banner',
|
||||
// phpcs:disable Generic.Files.LineLength.MaxExceeded
|
||||
'secondary_button_url' => 'https://www.strattic.com/static-tools/?utm_campaign=learn-more&utm_source=wp2static&utm_medium=wp-dash&utm_term=multilingual&utm_content=wp-notification-banner',
|
||||
];
|
||||
break;
|
||||
case 'polylang':
|
||||
$notice_contents = [
|
||||
'title' =>
|
||||
'Create dynamic, multi-lingual static websites using Strattic by Elementor!',
|
||||
// phpcs:disable Generic.Files.LineLength.MaxExceeded
|
||||
'message' => 'Strattic by Elementor lets you use Polylang on your static site, without implementing any extra configurations. Get 14 days for free. No credit card required!',
|
||||
// phpcs:disable Generic.Files.LineLength.MaxExceeded
|
||||
'primary_button_url' => 'https://www.strattic.com/pricing/?utm_campaign=start-trial&utm_source=wp2static&utm_medium=wp-dash&utm_term=multilingual&utm_content=wp-notification-banner',
|
||||
// phpcs:disable Generic.Files.LineLength.MaxExceeded
|
||||
'secondary_button_url' => 'https://www.strattic.com/static-tools/?utm_campaign=learn-more&utm_source=wp2static&utm_medium=wp-dash&utm_term=multilingual&utm_content=wp-notification-banner',
|
||||
];
|
||||
break;
|
||||
}
|
||||
|
||||
return $notice_contents;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue