WordPress.org

Ready to get started?Download WordPress

Forums

Subscribe2
[resolved] Custom Field in notification email? (13 posts)

  1. SpaciousMind
    Member
    Posted 1 year ago #

    Hi, I saw another thread about this but it seemed unclear.

    First let me say thanks for this plugin, it is really great and except for this issue below it does everything we were looking for.

    I am running a blog that uses the Custom Authors plugin since each post has a different guest author (most of whom are not WP savvy, so rather than create a user for each and have them struggle to figure out how to post and potentially screw things up, my job is to take their text and images and create and publish the posts myself). I create all the posts as Admin, and a custom field then inserts the Custom Author's name into the post.

    When I use {AUTHORNAME} in the email that goes out, it shows up as my Admin name and not the Custom Author.

    Any help on how to get this custom field in there instead would be appreciated.

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

  2. mattyrob
    Member
    Plugin Contributor

    Posted 1 year ago #

    @SpaciousMind,

    This may be possible but I'll need to look at how this other plugin works and see if I can make Subscribe2 compatible.

  3. mattyrob
    Member
    Plugin Contributor

    Posted 1 year ago #

    @SpaciousMind,

    Try this and let me know if it works. If you are sending per-post notifications look in the wp-content/plugins/subscribe2/classes/ folder and edit the class-s2-core.php file.

    In the publish() function around line 530 you'll see this:
    $this->authorname = $author->display_name;
    Try changing that to this:
    $this->authorname = apply_filter('the_author', $author->display_name);

    If you are using digest based email instead look at the subscribe2_cron() function around line 1517, you'll see:

    $message_post .= " (" . __('Author', 'subscribe2') . ": " . $author->display_name . ")";
    $message_posttime .= " (" . __('Author', 'subscribe2') . ": " . $author->display_name . ")";

    Try changing that to:

    $message_post .= " (" . __('Author', 'subscribe2') . ": " . apply_filter('the_author', $author->display_name) . ")";
    $message_posttime .= " (" . __('Author', 'subscribe2') . ": " . apply_filter('the_author', $author->display_name) . ")";
  4. mattyrob
    Member
    Plugin Contributor

    Posted 1 year ago #

    @SpaciousMind,

    Whoops, just noticed that the apply_filter should be apply_filters - note the missing trailing 'S' - otherwise the code is correct.

  5. SpaciousMind
    Member
    Posted 1 year ago #

    Hey MattyRob

    Thanks for the help... this doesn't seem to work unfortunately, still displays my admin name and not the Custom Author name.

  6. mattyrob
    Member
    Plugin Contributor

    Posted 1 year ago #

    @SpaciousMind,

    How did you test? For a brand new post or a preview? Also are you on per-post or digest settings in Subscribe2?

    I've done some more digging and have things working to a degree in my test setup, I want to make sure I've covered your scenario though.

  7. SpaciousMind
    Member
    Posted 1 year ago #

    @MattyRob

    I have tested both a preview and a new post. After replacing the code you mention above and trying a new post, it now shows a blank rather than my Admin name, which it was doing on previews of posts made before the code change. This blank also happens with subsequent previews.

    We're not using digest, just per-post.

  8. mattyrob
    Member
    Plugin Contributor

    Posted 1 year ago #

    @SpaciousMind,

    I've literally just checked in some changes to the core code that should fix the blank author name. I found a few issues in some testing I did over the weekend.

    Give the code here a try:
    http://downloads.wordpress.org/plugin/subscribe2.zip

  9. SpaciousMind
    Member
    Posted 1 year ago #

    Still not working for me... I have a more knowledgeable programmer friend looking into it and will report back once he's had a chance to get in there and check it out.

  10. mattyrob
    Member
    Plugin Contributor

    Posted 1 year ago #

    @SpaciousMind,

    I appreciate the feedback and look forward to hearing from you if you get anywhere.

  11. SpaciousMind
    Member
    Posted 1 year ago #

    How do I contact you? Not finding any way to do so on your site.

  12. mattyrob
    Member
    Plugin Contributor

    Posted 1 year ago #

    @SpaciousMind,

    Either using this forum :) or here.

  13. mattyrob
    Member
    Plugin Contributor

    Posted 1 year ago #

    @SpaciousMind,

    I've not received any direct contact yet, have you tried?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic