ID;
/* Check that the user hasn't already clicked to ignore the message */
if ( get_user_meta( $user_id, 'hestia_ignore_multi_language_upsell_notice' ) ) {
return;
}
if ( ! $this->should_display_translate_notice() ) {
return;
}
echo '
';
printf( '
', '?hestia_nag_ignore=0' );
echo '
';
/* translators: Upsell to get the pro version */
printf( esc_html__( 'Hestia front-page is not multi-language compatible, for this feature %s.', 'hestia' ), sprintf( '%2$s', esc_url( apply_filters( 'hestia_upgrade_link_from_child_theme_filter', 'https://themeisle.com/themes/hestia-pro/upgrade/' ) ), esc_html__( 'Get the PRO version!', 'hestia' ) ) );
echo '
';
echo '
';
}
/**
* Check if Polylang, TranslatePress or WPML are installed
* and the custom frontpage is selected
*
* @return bool
*/
private function should_display_translate_notice() {
if ( defined( 'HESTIA_PRO_FLAG' ) ) {
return false;
}
if ( get_option( 'show_on_front' ) === 'page' ) {
if ( defined( 'POLYLANG_VERSION' ) ) {
return true;
}
if ( defined( 'TRP_PLUGIN_VERSION' ) ) {
return true;
}
if ( get_option( 'icl_sitepress_settings' ) !== false ) {
return true;
}
return false;
}
}
/**
* Ignore notice.
*/
public function ignore_multi_language() {
global $current_user;
$user_id = $current_user->ID;
/* If user clicks to ignore the notice, add that to their user meta */
if ( isset( $_GET['hestia_nag_ignore'] ) && '0' == $_GET['hestia_nag_ignore'] ) {
add_user_meta( $user_id, 'hestia_ignore_multi_language_upsell_notice', 'true', true );
}
}
}