Adds meta tabs, sections and fields for the module to the form edit page.
Description
See also
Parameters
- $edit_page
-
(awsmug\Torro_Forms\DB_Objects\Forms\Form_Edit_Page_Handler) (Required) Edit page handler.
Source
File: src/modules/module.php
protected final function add_meta( $edit_page ) { $tabs = $this->get_meta_tabs(); if ( empty( $tabs ) ) { return; } $fields = $this->get_meta_fields(); $meta_box_id = $this->get_meta_identifier(); $edit_page->add_meta_box( $meta_box_id, array( 'title' => $this->get_title(), 'context' => 'normal', 'priority' => 'high', ) ); foreach ( $tabs as $slug => $args ) { $args['meta_box'] = $meta_box_id; $edit_page->add_tab( $slug, $args ); } foreach ( $fields as $slug => $args ) { $type = 'text'; if ( isset( $args['type'] ) ) { $type = $args['type']; unset( $args['type'] ); } $edit_page->add_field( $slug, $type, $args ); } }
Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |