HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wpicare/wp-content/updraft/plugins-old/metform/widgets/form-basic.php
<?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()));
	}
}