WordPress.org

Forums

Contact Form 7
[resolved] Fatal error: Call to undefined method WPCF7_ContactForm::replace_mail_tags() (3 posts)

  1. Tim Berneman
    Member
    Posted 9 months ago #

    I just noticed that I'm getting an error using CF7 3.9.1 "Fatal error: Call to undefined method WPCF7_ContactForm::replace_mail_tags()" in a special function that I wrote. This may have been since the major change in CF7 3.9 and gone undetected. Was that function deprecated or is there an alternative?

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

  2. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 9 months ago #

    You can use wpcf7_mail_replace_tags() for an alternative.

    $mail_body_after = wpcf7_mail_replace_tags( $mail_body_before );
  3. Tim Berneman
    Member
    Posted 9 months ago #

    That worked!

    My line of code was:
    $output = $cf7->replace_mail_tags( $cf7->mail["body"] );

    I changed it to:
    $output = wpcf7_mail_replace_tags( $cf7->mail["body"] );

    Thanks!!

Reply

You must log in to post.

About this Plugin

  • Contact Form 7
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags