Open the module file that you want a title for. For example, if you want to add a title attribute to text, open the modules/text.php file. Inside the wpcf7_text_shortcode_handler() function define a variable $title_att
in exactly the same way $class_att
is defined.
In the foreach
loop, add a case for the title_att
elseif ( preg_match( '%^title:([-0-9a-zA-Z_@\.]+)$%', $option, $matches ) ) {$title_att .= ' ' . $matches[1];}
Then below that, add an if statement to include the title attribute
if ( $title_att )<br />
$atts .= ' title="' . trim( $title_att ) . '"';
Essentially, copy the $class_att
variable but rename class to title.
awesome! just what i was looking for.
thanks.
oh wait! what about spaces?
any ideas?