<?php namespace Elementor; defined( 'ABSPATH' ) || exit; class Widget_Met_Form_Basic extends Widget_Base { public function get_name() { return 'metform-basic'; } public function get_title() { return esc_html__( 'MetForm Basic', 'metform' ); } public function show_in_panel() { return 'metform-form' != get_post_type(); } public function get_categories() { return [ 'metform' ]; } public function get_keywords() { return ['metform', 'form']; } public function get_all_forms(){ $form_list = []; $args = array( 'posts_per_page' => -1, 'post_type' => 'metform-form', 'post_status' => 'publish', ); $forms = get_posts( $args ); foreach($forms as $form){ $form_list[$form->ID] = $form->post_title; } return $form_list; } protected function register_controls() { $this->start_controls_section( 'content_section', [ 'label' => esc_html__( 'Content', 'metform' ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'mf_form_id', [ 'label' => esc_html__( 'Select Form : ', 'metform' ), 'type' => Controls_Manager::SELECT, 'default' => '', 'options' => $this->get_all_forms(), ] ); $this->end_controls_section(); } protected function render( $instance = [] ) { $settings = $this->get_settings_for_display(); \MetForm\Utils\Util::metform_content_renderer(\MetForm\Utils\Util::render_form_content($settings['mf_form_id'], $this->get_id())); } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
button | Folder | 0755 |
|
|
checkbox | Folder | 0755 |
|
|
date | Folder | 0755 |
|
|
Folder | 0755 |
|
||
file-upload | Folder | 0755 |
|
|
gdpr-consent | Folder | 0755 |
|
|
listing-fname | Folder | 0755 |
|
|
listing-lname | Folder | 0755 |
|
|
listing-optin | Folder | 0755 |
|
|
multi-select | Folder | 0755 |
|
|
number | Folder | 0755 |
|
|
password | Folder | 0755 |
|
|
radio | Folder | 0755 |
|
|
range | Folder | 0755 |
|
|
rating | Folder | 0755 |
|
|
recaptcha | Folder | 0755 |
|
|
select | Folder | 0755 |
|
|
simple-captcha | Folder | 0755 |
|
|
summary | Folder | 0755 |
|
|
switch | Folder | 0755 |
|
|
telephone | Folder | 0755 |
|
|
text | Folder | 0755 |
|
|
textarea | Folder | 0755 |
|
|
time | Folder | 0755 |
|
|
url | Folder | 0755 |
|
|
form-basic.php | File | 1.48 KB | 0644 |
|
form.php | File | 4.94 KB | 0644 |
|
manifest.php | File | 5.62 KB | 0644 |
|
widget-notice.php | File | 1.25 KB | 0644 |
|