Returns an array representation of the model.
Description
See also
Parameters
- $include_meta
-
(bool) (Optional) Whether to include metadata for each model in the collection.
Default value: true
Return
(array) Array including all information for the model.
Source
File: src/db-objects/forms/form.php
public function to_json( $include_meta = true ) { $data = parent::to_json( $include_meta ); /** * Filters the form tag classes. * * @since 1.0.0 * * @param array $form_classes Array of form classes. * @param Form $form Form object. */ $form_classes = apply_filters( "{$this->manager->get_prefix()}form_classes", array( 'torro-form' ), $this ); /** * Filters the form action URL. * * @since 1.0.0 * * @param string $form_action_url Form action URL. * @param int $form_id Form ID. */ $form_action_url = apply_filters( 'torro_form_action_url', home_url( $_SERVER['REQUEST_URI'] ), (int) $this->original->ID ); $data['form_attrs'] = array( 'id' => 'torro-form-' . $this->original->ID, 'class' => implode( ' ', $form_classes ), 'action' => $form_action_url, 'method' => 'post', 'enctype' => 'multipart/form-data', 'novalidate' => true, ); return $data; }
Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |