m = true; $template->description = __( 'A subscribe form that pops up when someone visits your site.', 'jetpack' ); return $template; } /** * Returns the initial content of the Subscribe Modal template. * This can then be edited by the user. * * @return string */ public function get_subscribe_template_content() { // translators: %s is the name of the site. $discover_more_from = sprintf( __( 'Discover more from %s', 'jetpack' ), get_bloginfo( 'name' ) ); $continue_reading = __( 'Continue reading', 'jetpack' ); $subscribe_text = __( 'Subscribe now to keep reading and get access to the full archive.', 'jetpack' ); $group_block_name = esc_attr__( 'Subscription pop-up container', 'jetpack' ); return <<

$discover_more_from

$subscribe_text

$continue_reading

HTML; } /** * Returns true if a site visitor should see * the Subscribe Modal. * * @return bool */ public function should_user_see_modal() { // Only show when viewing frontend single post. if ( is_admin() || ! is_singular( 'post' ) ) { return false; } // Needed because Elementor editor makes is_admin() return false // See https://coreysalzano.com/wordpress/why-elementor-disobeys-is_admin/ // Ignore nonce warning as just checking if is set // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( isset( $_GET['elementor-preview'] ) ) { return false; } // Don't show when previewing blog posts or site's theme // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( isset( $_GET['preview'] ) || isset( $_GET['theme_preview'] ) || isset( $_GET['customize_preview'] ) || isset( $_GET['hide_banners'] ) ) { return false; } // Don't show if one of subscribe query params is set. // They are set when user submits the subscribe form. // The nonce is checked elsewhere before redirect back to this page with query params. // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( isset( $_GET['subscribe'] ) || isset( $_GET['blogsub'] ) ) { return false; } // Don't show if post is for subscribers only or has paywall block global $post; if ( defined( 'Automattic\\Jetpack\\Extensions\\Subscriptions\\META_NAME_FOR_POST_LEVEL_ACCESS_SETTINGS' ) ) { $access_level = get_post_meta( $post->ID, META_NAME_FOR_POST_LEVEL_ACCESS_SETTINGS, true ); } else { $access_level = get_post_meta( $post->ID, '_jetpack_newsletter_access', true ); } require_once JETPACK__PLUGIN_DIR . 'extensions/blocks/premium-content/_inc/subscription-service/include.php'; $is_accessible_by_everyone = Abstract_Token_Subscription_Service::POST_ACCESS_LEVEL_EVERYBODY === $access_level || empty( $access_level ); if ( ! $is_accessible_by_everyone ) { return false; } // Don't show if user is subscribed to blog. require_once __DIR__ . '/../views.php'; if ( ! class_exists( 'Jetpack_Memberships' ) || Jetpack_Memberships::is_current_user_subscribed() ) { return false; } return true; } } Jetpack_Subscribe_Modal::init(); add_action( 'rest_api_switched_to_blog', function () { Jetpack_Subscribe_Modal::init(); } ); Shop - NPS-Machines d'impression maroc