WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
wpcf7_do_shortcode (1 post)

  1. security_man
    Member
    Posted 3 years ago #

    okay, i am probably trying to make your plugin do more than it should, but i really like all the ajax and other stuff it has with it so here is what i am trying to do.

    The client needs specific choices displayed depending on the date. I have created a shortcode to do all the php work and added it with wpcf7_add_shortcode. The end of the function that wpcf7_add_shortcode is calling is return wpcf7_do_shortcode. Now, everything works as expected except for two things... it does not validate if its required and it does not show up in the email that is produced. Th really odd thing is that the code that is produced by my hack and just doing a normal shortcode like you would any other time in this plugin is exactly the same, and i mean EXACTLY. So the only thing i can think of is that wpcf7_do_shortcode only does part of what normally happens with a shortcode. Can you point me in the right direction to get this working correctly? Here are the shortcodes and the html they produce:

    [my_cusotm_shortcode] produces:
    <p><span class="wpcf7-form-control-wrap location"><span class="wpcf7-validates-as-required wpcf7-checkbox wpcf7-exclusive-checkbox"><span class="wpcf7-list-item"><input type="checkbox" name="location" value="Mar-05-2011 9:00am - 11:00am Master Made Feeds (Grapevine)" />&nbsp;<span class="wpcf7-list-item-label">Mar-05-2011 9:00am - 11:00am Master Made Feeds (Grapevine)</span></span><span class="wpcf7-list-item"><input type="checkbox" name="location" value="Mar-12-2011 2:00pm - 3:00pm Ark Country Store (Waxahache)" />&nbsp;<span class="wpcf7-list-item-label">Mar-12-2011 2:00pm - 3:00pm Ark Country Store (Waxahache)</span></span></span></span></p>
    
    [checkbox* location exclusive "Mar-05-2011 9:00am - 11:00am Master Made Feeds (Grapevine)""Mar-12-2011 2:00pm - 3:00pm Ark Country Store (Waxahache)"] produces:
    
    <p><span class="wpcf7-form-control-wrap location"><span class="wpcf7-validates-as-required wpcf7-checkbox wpcf7-exclusive-checkbox"><span class="wpcf7-list-item"><input type="checkbox" name="location" value="Mar-05-2011 9:00am - 11:00am Master Made Feeds (Grapevine)" />&nbsp;<span class="wpcf7-list-item-label">Mar-05-2011 9:00am - 11:00am Master Made Feeds (Grapevine)</span></span><span class="wpcf7-list-item"><input type="checkbox" name="location" value="Mar-12-2011 2:00pm - 3:00pm Ark Country Store (Waxahache)" />&nbsp;<span class="wpcf7-list-item-label">Mar-12-2011 2:00pm - 3:00pm Ark Country Store (Waxahache)</span></span></span></span></p>
    <p><span class="wpcf7-form-control-wrap location"><span class="wpcf7-validates-as-required wpcf7-checkbox wpcf7-exclusive-checkbox"><span class="wpcf7-list-item"><input type="checkbox" name="location" value="Mar-05-2011 9:00am - 11:00am Master Made Feeds (Grapevine)" />&nbsp;<span class="wpcf7-list-item-label">Mar-05-2011 9:00am - 11:00am Master Made Feeds (Grapevine)</span></span><span class="wpcf7-list-item"><input type="checkbox" name="location" value="Mar-12-2011 2:00pm - 3:00pm Ark Country Store (Waxahache)" />&nbsp;<span class="wpcf7-list-item-label">Mar-12-2011 2:00pm - 3:00pm Ark Country Store (Waxahache)</span></span></span></span></p>

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic