Skip to content

Instantly share code, notes, and snippets.

@jeherve
Last active March 25, 2016 14:34
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jeherve/6916682 to your computer and use it in GitHub Desktop.
[Jetpack] Exclude certain categories from Jetpack Subscriptions
<?php
/*
* Plugin Name: Exclude the asmodeus category from Jetpack Subscriptions
* Plugin URI: http://wordpress.org/plugins/jetpack/
* Description: Exclude the asmodeus category from Jetpack Subscriptions
* Author: Jeremy Herve
* Version: 1.0
* Author URI: http://jeremyherve.com
* License: GPL2+
*/
function jeherve_sub_exclude_cat() {
if ( in_category( 'asmodeus' ) ) {
return false;
}
}
add_filter( 'jetpack_is_post_mailable', 'jeherve_sub_exclude_cat' );
@uamv
Copy link

uamv commented Jun 29, 2015

Are subscriptions no longer run through this filter?

@R3IDV3
Copy link

R3IDV3 commented Mar 24, 2016

In case anyone stumbles across this gist, this is the current solution: https://jetpack.com/support/subscriptions/#filters

@jeherve
Copy link
Author

jeherve commented Mar 25, 2016

@R3IDV3 That's correct. We now use different filters.

@uamv I'm sorry, I didn't see your reply before. Gist doesn't seem to send out comment notifications...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment