organizer META emails into live "mailto:" links

Home Forums Calendar Products Events Calendar PRO organizer META emails into live "mailto:" links

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #957175
    Philip Macaulay
    Participant

    Hi There guys,
    I wanted to turn the META (organizer) email on a event to a live link. I found Barry’s GitHub suggestion on the net:

     * Convert organizer emails into live "mailto:" links that users can click on.
     * 
     * @param  $email
     * @return string
     */
    function organizer_live_email_link( $email ) {
    	if ( ! is_email( $email ) ) return $email;
    	return '<a href="mailto:' . esc_attr( $email ) . '">' . esc_html( $email ) . '</a>';
    }
    
    add_filter( 'tribe_get_organizer_email', 'organizer_live_email_link' );
    
    

    And this works fine on the single event Organizer Meta Email – however it also affects the ORGANIZER page.

    Here is a link to a single event showing the now LIVE meta email link.

    And here is how this code affects the Organizer page

    The code seems to duplicate the email on the organizer page – I’ve ‘hacked’ about with it but I can’t resolve – Any suggestions on a fix please??

    Thanks

    Phil

    #957407
    Gustavo Bordoni
    Keymaster

    Hi Phillip,

    Thanks for reaching back to us again.

    I would like to say that is probably because your current Organizer template is already trying to implement this behavior in another non-global way.

    Anyways I’ve built a Snippet Plugin for you here that should take care of that. Follow the instructions on the link below:

    https://github.com/bordoni/tec-forum-support/tree/plugin-957175

    Remember to remove Barry’s code from your ‘functions.php’ file before anything else.

    My Best Regards,

    #957626
    Philip Macaulay
    Participant

    Thank you very much Gustavo – resolved my issue!

    #957825
    Gustavo Bordoni
    Keymaster

    Hi Phillip,

    That sounds awesome man, I’ve marked the correct answer on this thread and I will close it.

    My Best Regards,

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘organizer META emails into live "mailto:" links’ is closed to new replies.