Add the form title to a hidden field (Contact Form 7 WP Plugin)

1

Good afternoon,

You can add the form title of the Contact Form 7 (Wordpress) plugin in a hidden field

This is the shortcut used by the plugin:

[contact-form-7 id="86" title=" Contact Title "]

This is because I have a page with some options that open in a modal window, and in that window there is a form. I was able to change the URL of the page with an id but the "Contact Form 7 Dynamic Text Extension" plugin will only fetch these parameters if it exists when I open the page and not if I change it after the page is loaded.

EDITION:

However, I was able to access the form name with this script:

// add sortcut [hidden]
wpcf7_add_shortcode('hidden', 'wpcf7_sourceurl_shortcode_handler', true);

//função para ir buscar o titulo do formulário
function wpcf7_sourceurl_shortcode_handler() {

$name = "titulo_curso";
$form = wpcf7_get_current_contact_form(); // info sobre o formulário
echo '<pre>' . var_dump($form) . '</pre>';  
$html = '<input type="hidden" name="' . $name . '" value="' . $form->name() . '" />';

return $ html; }

However, there is a problem because I will only get the title that is given in the backoffice, if I change the title in shortcut [contact-form-7 id="86" title=" Shortcut title "] sends me the title of the backoffice.

Is there any way to get the title I inserted in shortcut?

Thank you

    
asked by anonymous 23.05.2016 / 12:39

0 answers