• Hi,

    I am not very good with actions and filters. So, I would need help.

    I would like to use the author filter to set the author of submitted posts.

    So, how would I write the function if :

    • The author id is 7
    • The form id is 2966
    • The fields in my form are email=>email title=>text category=>checkbox summary=>textarea image=>file
    • The cf7key is “share”

    I know how to put the filter in the function.php file of my child theme.

    It is just, I don’t no how to put the correct parameters in the function :

    add_filter('cf7_2_post_author_suggestion', 'set_suggestion_author',10,4);
    function set_suggestion_author($author_id, $cf7_id, $submitted_data, $cf7_key){
      return $author_id;
    }

    Any help I could get will be greatly appreciated.

    Thank you.

  • The topic ‘Using the author filter’ is closed to new replies.