WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
Embed Shortcode (3 posts)

  1. tloetz
    Member
    Posted 2 years ago #

    Is there a way to embed a shortcode in my contact form that will execute when the Submit button is hit?

    I am trying to use the GoToWebinar Registration plugin in conjunction with Contact Form 7 so the user will automatically be registered for a webinar and I will also get an email.

  2. kimipooh
    Member
    Posted 2 years ago #

    I'm think so, too.
    Then, in my case, I'd like to embed other shortcode to Contact form 7.

    ---
    For example.

    [text* your-name]

    * Please see [link id="10"] about the format.
    [text* sample]

    ---
    I'd like to use link information instead of [link id="10"].
    Now, it don't work.

    * I found out how to implement it.
    ------

    contact-form-7/includes/classes.php
    	function form_do_shortcode() {
    		global $wpcf7_shortcode_manager;
    
    		$form = $this->form;
    
                    $form = do_shortcode($form);  // ***Added***
    
    		if ( WPCF7_AUTOP ) {
  3. kimipooh
    Member
    Posted 2 years ago #

    Sorry for mistaking above code.
    Please forgets above code.

    Right

    contact-form-7/includes/shortcodes.php
    
    	function do_shortcode( $content, $exec = true ) {
    		$this->exec = (bool) $exec;
    		$this->scanned_tags = array();
    
    		$content = do_shortcode($content); // *** Added **
    
    		if ( empty( $this->shortcode_tags ) || ! is_array( $this->shortcode_tags ) )

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic