Server IP : 15.235.198.142 / Your IP : 216.73.216.14 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ballsack 6.8.0-45-generic #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/yme/wp-content/plugins/elementor-pro/modules/forms/submissions/data/ |
Upload File : |
<?php namespace ElementorPro\Modules\Forms\Submissions\Data; use Elementor\Data\Base\Controller as Controller_Base; use ElementorPro\Modules\Forms\Submissions\Database\Entities\Form_Snapshot; use ElementorPro\Modules\Forms\Submissions\Database\Repositories\Form_Snapshot_Repository; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } class Forms_Controller extends Controller_Base { public function get_name() { return 'forms'; } public function get_items( $request ) { $forms = Form_Snapshot_Repository::instance()->all(); // For now return only as "options" return [ 'data' => $forms->map(function ( Form_Snapshot $form ) { return [ 'label' => $form->get_label(), 'value' => $form->get_key(), ]; })->values(), 'meta' => [], ]; } public function register_endpoints() { // } protected function register_internal_endpoints() { // Register as internal to remove the default endpoint generated by the base controller. $this->register_endpoint( Endpoints\Forms_Index::class ); } public function get_permission_callback( $request ) { return current_user_can( 'manage_options' ); } }