Reputation: 57
I've been looking around and everyone says the solution is to take "send" out of the following code:
if ( empty( $value ) )
$value = __('send', 'wpcf7');
That's the first thing I did after I replaced my submit button with an image but 'Send' is still overlaid the submit button image, and I'm at a loss as to what to do. This is what my CSS code looks like:
/* Shortcode handler */
add_action( 'init', 'wpcf7_add_shortcode_submit', 5 );
function wpcf7_add_shortcode_submit() {
wpcf7_add_shortcode( 'submit', 'wpcf7_submit_shortcode_handler' );
}
function wpcf7_submit_shortcode_handler( $tag ) {
$tag = new WPCF7_Shortcode( $tag );
$class = wpcf7_form_controls_class( $tag->type );
$atts = array();
$atts['class'] = $tag->get_class_option( $class );
$atts['id'] = $tag->get_option( 'id', 'id', true );
$atts['tabindex'] = $tag->get_option( 'tabindex', 'int', true );
$value = isset( $tag->values[0] ) ? $tag->values[0] : '';
if ( empty( $value ) )
$value = __(' ', 'wpcf7');
$atts['class'] = 'button';
$atts['type'] = 'submit';
$atts['value'] = $value;
$atts = wpcf7_format_atts( $atts );
$html = sprintf( '<input %1$s />', $atts );
return $html;
}
NB: I've taken "send" out, leaving a space like ' ' instead of '', in fact I've tried every combination but nothing.
Would it have to do with how I created the submit button image? In the latest version of CF7 I had to add $atts['class'] = 'button';
into my submit.php before adding the following into my CSS
.button {
background-image: url("imageurl.gif");
background-repeat: no-repeat;
margin: 0px 0px 0px 0px;
padding: 0px;
float: left;
height: 35px;
width: 133px;
border: 0 none;
cursor: pointer;
}
Any help would be greatly appreciated.
Upvotes: 1
Views: 5612
Reputation: 21
If you're looking for a blank button using Contact Form 7
[submit " "]
Upvotes: 1
Reputation: 29
In the the latest version (at the time of writing) in modules submit.php
At line 27 Change
if ( empty( $value ) )
$value = __( 'Send', 'contact-form-7' );
to
if ( empty( $value ) )
$value = __( ' ', 'contact-form-7' );
Upvotes: 0
Reputation: 2849
No Need to touch the code to change the message of the submit button. Go into your wp dashboard < Contact and change this line
<p>[submit "Send"]</p>
to
<p>[submit "Anything you would like here"]</p>
Upvotes: 4
Reputation: 726
Trial and error.
Replace everywhere it says "Submit" with something else like "Test" and change each one until it works. Then you will know exactly which one to change.
Upvotes: 0