WordPress.org

Support

Support » Plugins and Hacks » PHPEnkoder » [Plugin: PHPEnkoder] Can PHP-Enkoder be used with the_author_email();

[Plugin: PHPEnkoder] Can PHP-Enkoder be used with the_author_email();

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author michael_greenberg

    @michael_greenberg

    Sorry I spotted this so late: it should be possible to add the_author_email to the list of hooks on line 209, in enkoder_manage_filters.

    Michael!

    That is SO awesome!! Thank you so much for your reply!!!! So, if I’m correct, the new line would look something like this:

    function enkoder_manage_filters($action) {
    $content_hook = array('the_content', 'get_comment_text', 'the_author_email');

    Is that right?

    I REALLY appreciate your help – no matter the wait!!! I can’t wait to get this working. 🙂

    Plugin Author michael_greenberg

    @michael_greenberg

    Yep, that looks right to me. If you want to enable it on comments, too, then you could throw in get_comment_author_email. Let me know if it works!

    Hhhmmm. I wonder if I’m missing something. Do I need to do an extra step? I see above the function in question it says “”to set up, pass in ‘add_action’. Do I need to add some extra code to my single template where I call the_author_email ? Or should this beautiful thing be working, as is?

    Plugin Author michael_greenberg

    @michael_greenberg

    Short version: should work as is, just put in the extra hook to the list.

    Also, it shouldn’t hurt anything to make the change—PHPEnkoder should never change your database, only the way your blog is displayed. You can always back out your changes without hurting anything.

    Long version: the comment is to remind programmers that this same function is responsible for both setting up and tearing down all of the filters. You’re just adding a hook, and the rest of the set-up/tear-down logic can stay the same.

    Shoot. I’ll root around some more and see if I can’t get it to work. Again, thanks so much for your help!! I really hope I can get it to work — I know it will be a HUGE help! 🙂

    Plugin Author michael_greenberg

    @michael_greenberg

    So…I don’t understand. Did you try it? Does it work?

    I did try! And it isn’t working yet…. I added all of these JUST to make sure I didn’t miss anything:

    $content_hook = array('the_content', 'get_comment_text', 'the_author_email', 'get_comment_author_email', 'get_the_author_email', 'get_avatar', 'the_author_meta');

    And I went back into my single template where the email appears and tried a couple of things. I saw that technically “the_author_email” is depreciated, so I even changed it to “the_author_meta(‘user_email’)” and added “the_author_meta” into the hook list (as you can see above).

    So, in my single page, this is how the area in question looks:

    <p class="author_email">">Contact the author</p>

    But when I view source it still shows the email written out. I’m sure I must be missing something.

    Oh, just realized I messed up the code in the single file. It should show <?php the_author_meta('user_email') ?>.

    I’m going to keep thinking about this!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: PHPEnkoder] Can PHP-Enkoder be used with the_author_email();’ is closed to new replies.
Skip to toolbar