/** * Post Form construct. * * @param string $id Form id. * @param string $post_type Post type Slug/Name. * @param string $post_status Post status. * @param array $attributes Form attributes. */ public function __construct($id, $post_type = 'post', $post_status = 'draft', $attributes = array()) { $this->id = $id; $this->post_type = $post_type; $this->post_status = $post_status; $this->attributes = $attributes; parent::__construct($this->id, '', 'post', $this->attributes); // Hooks save_post. add_action('vulcano_front_end_form_submitted_data_' . $this->id, array($this, 'save_post')); }
/** * Contact Form construct. * * @param string $id Form id. * @param mixed $to String with recipient or array with recipients. * @param array $cc Array with CC recipients. * @param array $bcc Array with BCC recipients. * @param array $attributes Form attributes. * @param array $attachment_type file or url in email body. */ public function __construct($id, $to, $cc = array(), $bcc = array(), $attributes = array(), $attachment_type = 'file') { $this->id = $id; $this->to = $to; $this->cc = $cc; $this->bcc = $bcc; $this->attributes = $attributes; $this->attachment_type = $attachment_type; parent::__construct($this->id, '', 'post', $this->attributes); // Hooks send_mail. add_action('vulcano_front_end_form_submitted_data_' . $this->id, array($this, 'send_mail'), 1, 2); }