WordPress.org

Ready to get started?Download WordPress

Forums

Subscribe2
[resolved] P2 Theme Excluded Formats (12 posts)

  1. Paul Oaten
    Member
    Posted 7 months ago #

    I'm using the plugin with the P2 theme. I have the following post formats excluded in the plugin settings:-

    • Link
    • Status
    • Quote

    However, whenever someone posts using one of these formats the emails still get sent. Can you help?

    http://wordpress.org/plugins/subscribe2/

  2. mattyrob
    Member
    Plugin Contributor

    Posted 7 months ago #

    @pcaweb,

    I cannot reproduce this issue using TwentyFourteen or P2 v1.5.2. If I have the format excluded in Subscribe2->Settings under the Registered Users tab the email doesn't send. If the formats are all unchecked then the email sends as expected.

    Have you checked for plugins conflicts?

  3. Paul Oaten
    Member
    Posted 7 months ago #

    Thx for the quick reply. It must be a conflict then I guess. Will start testing and let you know result.

  4. jonjennings
    Member
    Posted 6 months ago #

    Interestingly I've got exactly the same issue with a newly installed P2 today.

    P2 v1.5.2
    Subscribe2 v9.1
    WP 3.8

    I set Subscribe2 to not email link & quote post formats, but it's sending them out anyway.

    @pcaweb - did you manage to find out what was causing it?

  5. mattyrob
    Member
    Plugin Contributor

    Posted 6 months ago #

    @jonjennings,

    I have tested again with a vanilla install of WordPress 3.8 running P2 theme v1.5.2, Subscribe2 9.1, Email Log 1.6.1 and Akismet.

    I excluded the Quote format in Subscribe2->Settings in the Registered Users tab and then made a post in that format. No email was registered in the Email Log. I then made a regular post and a notification was generated.

  6. jonjennings
    Member
    Posted 6 months ago #

    Oh cool! I really appreciate that extra work - really good of you. Sorry we didn't find you a bug though :-(

    Seriously weird though... mine is pretty much the same thing - fresh install this morning with a couple of other minor plugins with I don't *think* would affect anything email-related. Actually I tried disabling ALL plugins except for Email Log & Subscribe2 - it still sent the email out to all users.

    [ Thanks for the mention of Email Log... I could have done with knowing about that a year ago :-) ]

    I do have the settings page right don't I? http://imgur.com/ol2yfTW

    Looks like it's not a bug or P2 interaction with Subscribe2 then... maybe something I'm missed or a setting that interferes with something. Fortunately it's only a 'friends & family' site so I can live with it. If I get some time in the next week or two I'll build a new P2 site with nobody else on it & try looking closer at the code.

    Thanks for your help

    Jon

  7. mattyrob
    Member
    Plugin Contributor

    Posted 6 months ago #

    @Jon,

    You settings look fine to me. You might want to check those other plugins you are running just for a sanity check.

  8. jonjennings
    Member
    Posted 6 months ago #

    Thanks! Only other plugins the site has are Members, P2 Likes, Who's Online & WP User Avatar - but I did try disabling all of them & running another test.

    I've just tried adding P2 & Subscribe2 to a scratch site I've got... and that's doing the same thing too. Most odd.

    Did some poking around in class-s2-core.php, around line 443 where it's checking post formats. get_post_format() is passed the correct post ID but returns false - ie it thinks the post is in standard format. Which is crazy because in both the P2 front-end display and in the back-end admin post editor it shows that the post is a quote.

    OK.. did some debug in WP core and looked at get_post_format(). I think I know why your tests were different to ours. If you post in the back end from the admin post editor then it works as expected, but if you post from P2's front page post box then it doesn't work.

    get_post_format() is called several times during the course of a post being committed & the first couple of times it has no information on the post format.

    This may be a bug in P2, or it may be possible for you to hook into the posting process at a later point.

  9. mattyrob
    Member
    Plugin Contributor

    Posted 6 months ago #

    @Jon,

    The issue seems to be that in the admin area when creating a post a placeholder is created in the database by a call to the get_default_post_to_edit() function. When adding new posts from the front side this isn't called and so the post placeholder doesn't exist.

    A post must have a ID before a call to set_post_format() can be made but to get a post ID you need to call wp_insert_post() which creates an ID but also the content and fires the WordPress transition hooks that cause Subscribe2 to send an email.

    In my opinion this need to be fixed in P2, they need to call get_default_post_to_edit() and follow the same publication route as the admin side.

  10. mattyrob
    Member
    Plugin Contributor

    Posted 6 months ago #

    @Jon,

    I had a few minutes to look at this and the fix in P2 is relatively simple. I have not found a place to open tickets for the P2 theme so have posted my tested (and as far as I can tell working) enhancement / fix in their forum:
    http://wordpress.org/support/topic/suggested-enhancement?replies=1#post-5142523

  11. jonjennings
    Member
    Posted 5 months ago #

    Nice work! Appreciate you taking the time to track that down. I see your patch has been passed to the devs... yay!

    P2's a great theme for its specific purpose & it strikes me that Subscribe2 makes a great pairing with it.

  12. mattyrob
    Member
    Plugin Contributor

    Posted 5 months ago #

    @Jon,

    Let's hope my patch is accepted.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags