WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
Add CSS Class to fields (4 posts)

  1. meg@info
    Member
    Posted 1 year ago #

    Hi,

    Is there a filters for adding more css class to fileds, ? im working with twitter bootstrap and i need to add css class to inputs, textarea and submit buttons .

    Thanks for answers,

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

  2. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 1 year ago #

    No, there are no filter for class. Instead, you can probably utilize wpcf7_form_tag filter you can find in the includes/shortcodes.php file for such purposes.

  3. meg@info
    Member
    Posted 1 year ago #

    Thanks for purposes,

    by dumping the $tag array by this code :

    add_filter( 'wpcf7_form_tag', 'dump_wpcf7_form_tag_filter' );
    function dump_wpcf7_form_tag_filter( $tag ) {
      if ( ! is_array( $tag ) )
      return $tag;
      echo "<pre>";
      var_dump($tag);
       echo "</pre>";
      return $tag;
    }

    ( PS: if you test the code, the result are double, it like do_shortcode_tag() is executed two time ?)

    I was made many tests, and i see that the css class for all components is returned by wpcf7_form_controls_class.

    i suggest adding a filter in wpcf7_form_controls_class function, this will make adding css class more easy.

    Reagrds,

  4. chrillep
    Member
    Posted 10 months ago #

    so if i was to add code to functions.php for bootstrap 3. How would i go about it?
    Ex. adding class "checkbox" to <input type="checkbox">.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags