Home › Forums › Front End PM PRO › fep_shortcode_message_to with field “to” hidden.
- This topic has 9 replies, 2 voices, and was last updated 6 years, 5 months ago by Shamim Hasan.
- AuthorPosts
- July 2, 2019 at 6:43 am #26406c-alleParticipant
hello, I use this php code to send a message to the profile user
echo do_shortcode (‘[fep_shortcode_message_to class = “um-pro-btn um-button” to=”{um-current-author}” text=”send message” subject=”Sending a message”]’);
but I have a problem.
I would like that if you click on the button the submit form will be loaded to send a message to the user of the profile but with the “to” field hidden or make it read-only. It’s possible?Source: https://wordpress.org/support/topic/fep_shortcode_message_to-with-field-to-hidden/
Thanks.
July 2, 2019 at 7:30 am #26409c-alleParticipantI found this post https://sp-test1.arogga.co/support/topic/make-to-field-fep_mr_to-readonly/, but the code does not work.
July 2, 2019 at 9:00 am #26412Shamim HasanKeymasterPlease let me know the value of front End PM PRO > Settings > Recipient > Max recipients
Also will you use the value as 1 or more? (Code will be different if you use 1)July 2, 2019 at 1:26 pm #26427c-alleParticipantHi, thanks for the reply.
My Front End number in PM PRO> Settings> Recipient> Max recipients is: 5.July 2, 2019 at 1:55 pm #26433Shamim HasanKeymasterAdd following code in your theme’s (child theme’s if you are using) functions.php
add_filter( 'fep_pro_filter_pre_populate', function( $pre_populate ){ if ( $pre_populate && is_array( $pre_populate ) ) { foreach ( $pre_populate as &$value ) { $value['readonly'] = true; } } return $pre_populate; });July 2, 2019 at 2:10 pm #26438c-alleParticipantThe form is loaded with the value (to) displayed correctly, but is not read-only.
July 2, 2019 at 6:13 pm #26447Shamim HasanKeymasterThat value is readonly not the full field.
A new hook is added in https://github.com/shamim2883/front-end-pm/commit/dc41347194c1767d83526ee16d3b1fc8c09dba8a#diff-78cd5aa3783a74555c9938a2a81d01c6R328 but not yet merged with latest version. Next version you will get it merged and we can use that hook to make full field readonly.July 2, 2019 at 6:23 pm #26449c-alleParticipantThanks you are very kind. I’ll wait for the new version.
July 11, 2019 at 5:32 pm #26806c-alleParticipantI updated the plugin to version 11.1.1. did you add the possibility to put the field (to) in readonly for the shortcode? If yes, how can I make it read-only? Thanks, you are always very kind.
July 11, 2019 at 8:31 pm #26812Shamim HasanKeymasterAdd following code in your theme’s (child theme’s if you are using) functions.php
add_filter( 'fep_filter_tokeninput_localize', function( $args ){ if ( isset( $_GET['fepaction'] ) && 'newmessage' == $_GET['fepaction'] && ! empty( $args['prePopulate'] ) && is_array( $args['prePopulate'] ) ) { $args['tokenLimit'] = count( $args['prePopulate'] ); foreach ( $args['prePopulate'] as &$value ) { $value['readonly'] = true; } } return $args; }); - 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.