Output author email in Shortcode

This topic contains 2 reply and 2 voices, and was last updated by Sk 9 years, 7 months ago
Viewing 2 Posts - 1 through 2 (of 2 total)
Author Posts
September 10, 2014 at 5:13 am 26565
Sk Hello, I have a front-end guest post form for directory listings. With a contact form plugin, i added a shortcode in theme file. <?php echo do_shortcode('[contact email_to="email@example.com"]'); ?> And I need help with getting email meta field output in that shortcode. So every time a user create listing. Contact form will send message to his/her email. Thanks
September 10, 2014 at 6:41 pm 26597
Alejandro Alejandro

Problem is solved. Here is solution if someone else need it.

<?php $contact_email = get_post_meta( $post->ID, 'contact_email', true );
echo do_shortcode('[contact email_to="'.$contact_email.'"]'); ?>
September 14, 2014 at 4:18 pm 26769
Sk Sk

Hello Alejandro,

Great work.

Thank you

Viewing 2 Posts - 1 through 2 (of 2 total)