Home › Forums › Front End PM PRO › New message form shortcode autopopulate to specific user
- This topic has 7 replies, 2 voices, and was last updated 7 years, 7 months ago by Larry Cottle.
- AuthorPosts
- April 24, 2018 at 10:25 pm #13654Larry CottleParticipant
1. When using the following, where godzilla is first name and monster is last name;
[fep_shortcode_new_message_form to="godzilla monster" subject="test"]the form DOES NOT show.
2. When using the following where godzilla is first name;
[fep_shortcode_new_message_form to="godzilla" subject="test"]the form shows as expected.
3. When using the following variable, where $first_name = ‘godzilla’;
[fep_shortcode_new_message_form to="$first_name" subject="test"]the form DOES NOT show.
I have tried a variable with various syntax with Zero succcess.
The only success I have had is #2 above.
The form shows as expected when using default pre populate.
What I need is to be able to use a variable for the to=$variable.
What am i doing wrong?
LJC
April 24, 2018 at 10:41 pm #13660Shamim HasanKeymasterPlease see https://sp-test1.arogga.co/docs/front-end-pm/shortcode/fep_shortcode_new_message_form/ for details of this shortcode. “To” argument support user_nicename (Not first name/last name etc).
Where are you adding this shortcode? In php template or in post editor? post editor can not process php code. To pass variable you have to add this in php template or anywhere where php code can be parsed. If you add in php template let me know full code of this shortcode so that i can correct for you if you have any error.
April 24, 2018 at 11:10 pm #13662Larry CottleParticipant<?php
Q Where are you adding this shortcode
A In php template where php code can be parsed
Heres The CODE:$user = ‘godzilla’;
echo do_shortcode(‘[fep_shortcode_new_message_form to=godzilla subject="test"]‘)
?>
the form shows as expected.<?php
$user = ‘godzilla’;
echo do_shortcode(‘[fep_shortcode_new_message_form to=$user subject="test"]‘)
?>the form DOES NOT show.
LJC
April 24, 2018 at 11:12 pm #13664Larry CottleParticipantDisregard Previous reply as it has an error
<?php
Q Where are you adding this shortcode
A In php template where php code can be parsed
Heres The CODE:echo do_shortcode(‘[fep_shortcode_new_message_form to=godzilla subject=”test”]’)
?>
the form shows as expected.<?php
$user = ‘godzilla’;
echo do_shortcode(‘[fep_shortcode_new_message_form to=$user subject=”test”]’)
?>the form DOES NOT show.
LJC
April 25, 2018 at 12:22 am #13666Shamim HasanKeymasterPlease use as
echo do_shortcode( '[fep_shortcode_new_message_form to="' . $user . '" subject="test"]' );April 25, 2018 at 1:35 am #13670Larry CottleParticipantThank you! That syntax worked! However the form will no longer populate in my lightbox.
Any ideas?
Have A Great Day!
LJC
April 25, 2018 at 12:27 pm #13677Shamim HasanKeymasterI do not see any lightbox code here. Check your syntax with lightbox code.
April 25, 2018 at 6:58 pm #13683Larry CottleParticipantI contacted theme author. They solved the problem. Works great now.
Thank you!
LJC
- AuthorPosts
You need to purchase ‘Front End PM PRO’ to create topic in this support forum.
If you already purchased ‘Front End PM PRO’ please LOGIN.