The Community forums are being phased out in favor of a new Slack group.
Add your email address below to get an invitation to join the community slack group
Customize Default Messages
Below is a simple shortcode that accepts two parameters - message, and page id.
// Custom message shortcode
function frm_custom_message_shrtcde( $atts ) {
$a = shortcode_atts( array(
'message' => 'You do not have permission to view this form.',
'pageid' => 1,
), $atts );
if (is_page( $a['pageid'] )) {
return $a['message'];
}else{
return "You do not have permission to view this form."; //default message
}
}
add_shortcode( 'frm_message', 'frm_custom_message_shrtcde' );
You can now add something like [frm_message message="my message" pageid=23] into the default message input fields. As noted, if the page isn't as defined in the shortcode, it will fall back on the default message.
Note: The page id as is, doesn't accept an array. However you can enter the shortcode multiple times. This was my quick version. If someone wants to drop the array tweak, I'll update my post.
June 1, 2016 at 1:04 pm
That's nice! Thanks for sharing, Robert.
August 13, 2018 at 10:17 am
Hi,
Does the customize shortcode above to be inserted in custom CSS?
Thank you
Discussion closed.