• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Jetpack a2z

Jetpack a2z

Jetpack a2z

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / Jetpack_Subscriptions::subscription_post_page_metabox() –

You appear to be a bot. Output may be restricted

Description

Usage

Jetpack_Subscriptions::subscription_post_page_metabox();

Parameters

Returns

void

Source

File name: jetpack/modules/subscriptions.php
Lines:

1 to 34 of 34
  function subscription_post_page_metabox() {
    if (
      
/**
 * Filter whether or not to show the per-post subscription option.
 *
 * @module subscriptions
 *
 * @since 3.7.0
 *
 * @param bool true = show checkbox option on all new posts | false = hide the option.
 */
       ! apply_filters( 'jetpack_allow_per_post_subscriptions', false ) )
    {
      return;
    }

    if ( has_filter( 'jetpack_subscriptions_exclude_these_categories' ) || has_filter( 'jetpack_subscriptions_include_only_these_categories' ) ) {
      return;
    }

    global $post;
    $disable_subscribe_value = get_post_meta( $post->ID, '_jetpack_dont_email_post_to_subs', true );
    // only show checkbox if post hasn't been published and is a 'post' post type.
    if ( get_post_status( $post->ID ) !== 'publish' && get_post_type( $post->ID ) == 'post' ) :
      // Nonce it
      wp_nonce_field( 'disable_subscribe', 'disable_subscribe_nonce' );
      ?>
			<div class="misc-pub-section">
				<label for="_jetpack_dont_email_post_to_subs"><?php _e( 'Jetpack Subscriptions:', 'jetpack' ); ?></label><br>
				<input type="checkbox" name="_jetpack_dont_email_post_to_subs" id="jetpack-per-post-subscribe" value="1" <?php checked( $disable_subscribe_value, 1, true ); ?> />
				<?php _e( 'Don&#8217;t send this to subscribers', 'jetpack' ); ?>
			</div>
		<?php endif;
  }
 

 View on GitHub View on Trac

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Pinterest (Opens in new window)

Related

Published: 27 November 2019 | Last updated: 27 November 2019

Primary Sidebar

Information

Function name: Jetpack_Subscriptions::subscription_post_page_metabox
Class ref: Jetpack_Subscriptions
Plugin ref: Jetpack
Version: 9.2
Sourcefile: modules/subscriptions.php
File ref: modules/subscriptions.php
Deprecated?: No
API Letters: J,P,S

Footer

Jetpack a2z
Jetpack a2z
Jetpack a2z
WordPress 5.6
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  jetpack.wp-a2z.org
© Copyright Jetpack a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites