: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
class WPCF7_ContactFormTemplate {
public static function get_default( $prop = 'form' ) {
$template = self::form();
} elseif ( 'mail' == $prop ) {
$template = self::mail();
} elseif ( 'mail_2' == $prop ) {
$template = self::mail_2();
} elseif ( 'messages' == $prop ) {
$template = self::messages();
return apply_filters( 'wpcf7_default_template', $template, $prop );
public static function form() {
[text* your-name autocomplete:name] </label>
[email* your-email autocomplete:email] </label>
[text* your-subject] </label>
[textarea your-message] </label>
__( '(optional)', 'contact-form-7' ),
__( 'Your name', 'contact-form-7' ),
__( 'Your email', 'contact-form-7' ),
__( 'Subject', 'contact-form-7' ),
__( 'Your message', 'contact-form-7' ),
__( 'Submit', 'contact-form-7' )
return trim( $template );
public static function mail() {
/* translators: 1: blog name, 2: [your-subject] */
_x( '%1$s "%2$s"', 'mail subject', 'contact-form-7' ),
/* translators: %s: [your-name] [your-email] */
__( 'From: %s', 'contact-form-7' ),
'[your-name] [your-email]'
/* translators: %s: [your-subject] */
__( 'Subject: %s', 'contact-form-7' ),
. __( 'Message Body:', 'contact-form-7' )
. "\n" . '[your-message]' . "\n\n"
/* translators: 1: blog name, 2: blog URL */
__( 'This is a notification that a contact form was submitted on your website (%1$s %2$s).', 'contact-form-7' ),
'recipient' => '[_site_admin_email]',
'additional_headers' => 'Reply-To: [your-email]',
public static function mail_2() {
/* translators: 1: blog name, 2: [your-subject] */
_x( '%1$s "%2$s"', 'mail subject', 'contact-form-7' ),
__( 'Message Body:', 'contact-form-7' )
. "\n" . '[your-message]' . "\n\n"
/* translators: 1: blog name, 2: blog URL */
__( 'This email is a receipt for your contact form submission on our website (%1$s %2$s) in which your email address was used. If that was not you, please ignore this message.', 'contact-form-7' ),
'recipient' => '[your-email]',
'additional_headers' => sprintf(
public static function from_email() {
$admin_email = get_option( 'admin_email' );
if ( wpcf7_is_localhost() ) {
$sitename = wp_parse_url( network_home_url(), PHP_URL_HOST );
$sitename = strtolower( $sitename );
if ( 'www.' === substr( $sitename, 0, 4 ) ) {
$sitename = substr( $sitename, 4 );
if ( strpbrk( $admin_email, '@' ) === '@' . $sitename ) {
return 'wordpress@' . $sitename;
public static function messages() {
foreach ( wpcf7_messages() as $key => $arr ) {
$messages[$key] = $arr['default'];
function wpcf7_messages() {
=> __( "Sender's message was sent successfully", 'contact-form-7' ),
=> __( "Thank you for your message. It has been sent.", 'contact-form-7' ),
=> __( "Sender's message failed to send", 'contact-form-7' ),
=> __( "There was an error trying to send your message. Please try again later.", 'contact-form-7' ),
'validation_error' => array(
=> __( "Validation errors occurred", 'contact-form-7' ),
=> __( "One or more fields have an error. Please check and try again.", 'contact-form-7' ),
=> __( "Submission was referred to as spam", 'contact-form-7' ),
=> __( "There was an error trying to send your message. Please try again later.", 'contact-form-7' ),
=> __( "There are terms that the sender must accept", 'contact-form-7' ),
=> __( "You must accept the terms and conditions before sending your message.", 'contact-form-7' ),
'invalid_required' => array(
=> __( "There is a field that the sender must fill in", 'contact-form-7' ),
=> __( "Please fill out this field.", 'contact-form-7' ),
'invalid_too_long' => array(
=> __( "There is a field with input that is longer than the maximum allowed length", 'contact-form-7' ),
=> __( "This field has a too long input.", 'contact-form-7' ),
'invalid_too_short' => array(
=> __( "There is a field with input that is shorter than the minimum allowed length", 'contact-form-7' ),
=> __( "This field has a too short input.", 'contact-form-7' ),
return apply_filters( 'wpcf7_messages', $messages );