You appear to be a bot. Output may be restricted
Description
Usage
Jetpack_Subscriptions::should_email_post_to_subscribers( $post );
Parameters
- $post
- ( mixed ) required –
Returns
void
Source
File name: jetpack/modules/subscriptions.php
Lines:
1 to 54 of 54
public function should_email_post_to_subscribers( $post ) { $should_email = true; if ( get_post_meta( $post->ID, '_jetpack_dont_email_post_to_subs', true ) ) { return false; } // Only posts are currently supported if ( $post->post_type !== 'post' ) { return false; } // Private posts are not sent to subscribers. if ( 'private' === $post->post_status ) { return false; } /** * Array of categories that will never trigger subscription emails. * * Will not send subscription emails from any post from within these categories. * * @module subscriptions * * @since 3.7.0 * * @param array $args Array of category slugs or ID's. */ $excluded_categories = apply_filters( 'jetpack_subscriptions_exclude_these_categories', array() ); // Never email posts from these categories if ( ! empty( $excluded_categories ) && in_category( $excluded_categories, $post->ID ) ) { $should_email = false; } /** * ONLY send subscription emails for these categories * * Will ONLY send subscription emails to these categories. * * @module subscriptions * * @since 3.7.0 * * @param array $args Array of category slugs or ID's. */ $only_these_categories = apply_filters( 'jetpack_subscriptions_exclude_all_categories_except', array() ); // Only emails posts from these categories if ( ! empty( $only_these_categories ) && ! in_category( $only_these_categories, $post->ID ) ) { $should_email = false; } return $should_email; }