I'm not expecting any help with integrations, but I'm wondering if there is something blocking me from being able to add a new topic from one of the Gravity Form action hooks. If I use the following code on a test page, I can add a topic just fine, but when I add it to a GF hook, such as 'gform_pre_submission' or 'gform_after_submission', I get an error saying I cannot use add() on NULL. I debug WPF() and it shows the object just fine, so the function is being called, but the 'topic' argument is showing blank. I did the same thing where it worked on a page and the 'topic' argument is showing an empty object instead. Also debugged WPF()->topic and it shows an empty object on the page, but NULL from the GF hook. Any suggestions to get this to work?
$args = [ 'userid' => 1, 'title' => 'New Request from Test', 'body' => 'This is a test', 'forumid' => 22, 'views' => 0, 'type' => 0, 'created' => date( 'Y-m-d H:i:s' ) ]; $add_topic = WPF()->topic->add( $args);
I also tried working around it by creating my own function that adds new table rows to the database, but it causes issues with being able to delete topics and posts, and some don't show up, so I know there is other stuff I'm missing.
I've already sent this topic to the developers. I'll keep you updated once I get a response from them.