public function create($data = array())
{
if ($this->id != 0) {
return false;
}
$defaults = array('post_type' => 'give_forms', 'post_status' => 'draft', 'post_title' => esc_html__('New Donation Form', 'give'));
$args = wp_parse_args($data, $defaults);
/**
* Fired before a donation form is created
*
* @param array $args The post object arguments used for creation.
*/
do_action('give_form_pre_create', $args);
$id = wp_insert_post($args, true);
$donation_form = WP_Post::get_instance($id);
/**
* Fired after a donation form is created
*
* @param int $id The post ID of the created item.
* @param array $args The post object arguments used for creation.
*/
do_action('give_form_post_create', $id, $args);
return $this->setup_donation_form($donation_form);
}