• Resolved yurka94

    (@yurka94)


    after successfully sending a message appears warning: You should switch from using my_cforms_action function to cforms2_after_processing_action WordPress action. in /home/u730139373/public_html/wp-content/plugins/cforms2/my-functions-deprecated.php on line 29 .
    Is it critical ? And how to resolve it ?

    https://wordpress.org/plugins/cforms2/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author bgermann

    (@bgermann)

    The message says how to resolve it. Just read through my-functions.php.txt for further information.

    A warning is by definition never critical.

    Thread Starter yurka94

    (@yurka94)

    Ok .I’ve just do that saying in my-functions.php.txt . I have put this file in plugin directory and activate it . And I’ve left one function :

    add_action(‘cforms2_after_processing_action’, function ($cformsdata) {

    `### Extract Data
    ### Note: $cformsdata[‘id’] = ” (empty) for the first form!

    $formID = $cformsdata[‘id’];
    $form = $cformsdata[‘data’];

    ### triggers on your third form
    if ( $formID == ‘3’ ) {

    ### Do something with the data or not, up to you
    $form[‘Your Name’] = ‘Mr./Mrs. ‘.$form[‘Your Name’];

    }

    ### Send to 3d party or do something else.
    ### You can throw an Exception. Its message is printed on the screen.
    if (!wp_mail(‘you@example.com’, ‘cforms my_action test’, print_r($form,1), ‘From: you@example.com’))
    throw new Exception(‘Mail could not be sent’);

    But warning still appears . Have I done something wrong ?

    Plugin Author bgermann

    (@bgermann)

    Somewhere you have defined a my_cforms_action function. You should replace it with cforms2_after_processing_action, but should not use both of them. I cannot tell you where to find my_cforms_action. It is in a custom plugin defined by you or whoever built the webpage. Or you still have the old cformsII version enabled. Then you should disable it.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘warning after sent message’ is closed to new replies.