WordPress.org

Forums

Contact Form 7
include shortcode in Additional Settings field (2 posts)

  1. gipix
    Member
    Posted 1 year ago #

    hi!

    i want to include a parametric shortcode in additional setting field.
    i want to redirect in a specific page using the on_sent_ok code.

    1. so i create a new short code with my link ( a pp link )

    add_shortcode( 'link_pp', 'gpx_cf7_pp_counter', true );
    function gpx_cf7_pp_counter( $atts )
    {
    // estraggo i parametri necessari da aggiornare!
    extract( shortcode_atts( array(
    'id' => '...',
    'item_name' => '...&',
    'item_number' => '2',
    'amount' => '0%2e00',
    'return_link' => '...',
    'cancel_return_link' => '...',
    'notify_url' => '...')
    , $atts ) );
    $output = 'https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&busin...';
    return $output;
    }

    2. and then i call a do_shortcode on additional setting field in this way:

    add_action("wpcf7_before_send_mail", "wpcf7_do_something");
    function wpcf7_do_something (&$WPCF7_ContactForm) {
    $WPCF7_ContactForm->additional_settings = do_shortcode( $WPCF7_ContactForm->additional_settings );
    }

    But this didn't work! I forgot something?
    There is a way to include custom shortcode in Additional Settings Field?

    Thanks

    http://wordpress.org/plugins/contact-form-7/

  2. Azarea
    Member
    Posted 1 year ago #

    Any news on this?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Contact Form 7
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic