• Resolved psubraty

    (@psubraty)


    Hi,

    I am trying to add your code:

    add_action( ‘cf7_2_post_status_post’, ‘publish_new_post’,10,3);
    /**
    * Function to change the post status of saved/submitted posts.
    * @param string $status the post status, default is ‘draft’.
    * @param string $ckf7_key unique key to identify your form.
    * @param array $submitted_data complete set of data submitted in the form as an array of field-name=>value pairs.
    * @return string a valid post status (‘publish’|’draft’|’pending’|’trash’)
    */
    function publish_new_post($status, $ckf7_key, $submitted_data){
    /*The default behaviour is to save post to ‘draft’ status. If you wish to change this, you can use this filter and return a valid post status: ‘publish’|’draft’|’pending’|’trash’*/
    return ‘publish’;
    }

    I am getting an error:
    Can’t use function return value in write context
    line 193, file: wp-content/plugins/post-my-contact-form-7/public/class-cf7-2-post-public.php

    I noticed people had similar problems with PHP5*, I am using 7.2. Am I doing sth wrong?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 16 through 17 (of 17 total)
Viewing 2 replies - 16 through 17 (of 17 total)
  • The topic ‘Can’t use function return value in write context (PHP 7.2)’ is closed to new replies.