Open raamdev opened 8 years ago
Right now the SubInserter() method can be used from anywhere outside of the plugin itself like this:
SubInserter()
<?php use WebSharks\CommentMail\Pro\SubInserter; $sub_insert_data = array( 'post_id' => 123, 'status' => 'subscribed', 'deliver' => 'asap', 'fname' => 'John', 'email' => 'john@example.com', ); $SubInserter = new SubInserter($sub_insert_data); // Inserts new subscriber. if ($SubInserter->hasErrors()) { print_r($SubInserter->errors()); //print_r($SubInserter->errorCodes()); //print_r($SubInserter->errorsHtml()); }
It would nice if we updated the API class and added a new method that was designed to create a new class instance via the API call instead.
public static function subInserter($data, $args = []) { return new SubInserter($data, $args); }
See docs for argument definitions: https://github.com/websharks/comment-mail-pro/blob/160618/src/includes/classes/SubInserter.php#L288
Right now the
SubInserter()
method can be used from anywhere outside of the plugin itself like this:It would nice if we updated the API class and added a new method that was designed to create a new class instance via the API call instead.
See docs for argument definitions: https://github.com/websharks/comment-mail-pro/blob/160618/src/includes/classes/SubInserter.php#L288