t->get_param( $collection_param_name ); if ( null !== $request_filter_value ) { $collection_param_values['value'] = $request_filter_value; $filters[ $collection_param_name ] = $collection_param_values; } } $result = $this->query->get_submissions( [ 'page' => $request->get_param( 'page' ), 'per_page' => $request->get_param( 'per_page' ), 'filters' => $filters, 'order' => [ 'order' => $request->get_param( 'order' ), 'by' => $request->get_param( 'order_by' ), ], ] ); $result['meta']['count'] = $this->query ->count_submissions_by_status( $filters ) ->all(); return $result; } public function get_item( $request ) { return $this->query->get_submission( (int) $request->get_param( 'id' ) ); } /** * @param \WP_REST_Request $request * * @return \WP_Error|\WP_REST_Response */ public function delete_items( $request ) { return $this->delete( $request->get_param( 'ids' ), $request->get_param( 'force' ) ); } /** * Delete single submission * * @param \WP_REST_Request $request * * @return \WP_Error|\WP_REST_Response */ public function delete_item( $request ) { return $this->delete( [ $request->get_param( 'id' ) ], $request->get_param( 'force' ) ); } /** * Update a single submission. * * @param \WP_REST_Request $request * * @return \WP_Error|\WP_REST_Response */ public function update_item( $request ) { return $this->update( [ (int) $request->get_param( 'id' ) ], $request ); } /** * Update multiple submissions. * * @param $request * * @return \WP_Error|\WP_REST_Response */ public function update_items( $request ) { return $this->update( $request->get_param( 'ids' ), $request ); } public function get_permission_callback( $request ) { return current_user_can( 'manage_options' ); } public function register_endpoints() { $this->register_endpoint( Endpoints\Restore::class ); $this->register_endpoint( Endpoints\Export::class ); $this->register_endpoint( Endpoints\Referer::class ); } protected function register_internal_endpoints() { // Register as internal to remove the default endpoint generated by the base controller. $this->register_endpoint( Endpoints\Index::class ); } protected function register() { parent::register(); $this->query = Query::get_instance(); } /** * Delete one or more submissions. * * @param array $ids * @param false $force * * @return Query_Failed_Response|\WP_Error|\WP_REST_Response */ private function delete( array $ids, $force = false ) { $affected = 0; $failed = 0; foreach ( $ids as $id ) { if ( $force ) { $affected_rows = $this->query->delete_submission( $id ); } else { $affected_rows = $this->query->move_to_trash_submission( $id ); } if ( false === $affected_rows ) { $failed++; } else { $affected += $affected_rows; } } if ( count( $ids ) === $failed ) { return new Query_Failed_Response( $this->query->get_last_error() ); } if ( 1 === count( $ids ) && 0 === $affected ) { return new \WP_Error( 'rest_not_found', __( 'Submission not found.', 'elementor-pro' ), [ 'status' => 404 ] ); } return new \WP_REST_Response( [ 'data' => [], 'meta' => [ 'affected' => $affected, 'failed' => $failed, ], ], 200 ); } /** * Update one or more submissions. * * @param array $ids * @param \WP_REST_Request $request * * @return Query_Failed_Response|\WP_Error|\WP_REST_Response */ private function update( array $ids, \WP_REST_Request $request ) { $allowed_args = ( new Collection( $request->get_attributes()['args'] ) ) ->except( [ 'id', 'ids', 'values' ] ) ->keys(); $data = ( new Collection( $request->get_body_params() ) ) ->only( $allowed_args ) ->all(); $values = $request->get_param( 'values' ); $affected = 0; $failed = 0; foreach ( $ids as $id ) { $affected_rows = $this->query->update_submission( $id, $data, $values ); if ( false === $affected_rows ) { $failed++; } else { $affected += $affected_rows; } } if ( count( $ids ) === $failed ) { return new Query_Failed_Response( $this->query->get_last_error() ); } if ( 1 === count( $ids ) ) { if ( 0 === $affected ) { return new \WP_Error( 'rest_not_found', __( 'Submission not found.', 'elementor-pro' ), [ 'status' => 404 ] ); } return new \WP_REST_Response( $this->query->get_submission( $ids[0] ) ); } return new \WP_REST_Response( [ 'data' => [], 'meta' => [ 'affected' => $affected, 'failed' => $failed, ], ], 200 ); } }
Fatal error: Uncaught Error: Class "ElementorPro\Modules\Forms\Submissions\Data\Controller" not found in /htdocs/wp-content/plugins/elementor/data/manager.php:88 Stack trace: #0 /htdocs/wp-content/plugins/elementor-pro/modules/forms/submissions/component.php(163): Elementor\Data\Manager->register_controller('ElementorPro\\Mo...') #1 /htdocs/wp-content/plugins/elementor-pro/modules/forms/module.php(199): ElementorPro\Modules\Forms\Submissions\Component->__construct() #2 /htdocs/wp-content/plugins/elementor-pro/modules/forms/module.php(280): ElementorPro\Modules\Forms\Module->register_submissions_component() #3 /htdocs/wp-content/plugins/elementor/core/base/module.php(85): ElementorPro\Modules\Forms\Module->__construct() #4 /htdocs/wp-content/plugins/elementor-pro/core/modules-manager.php(98): Elementor\Core\Base\Module::instance() #5 /htdocs/wp-content/plugins/elementor-pro/plugin.php(366): ElementorPro\Core\Modules_Manager->__construct() #6 /htdocs/wp-includes/class-wp-hook.php(324): ElementorPro\Plugin->on_elementor_init('') #7 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array) #8 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #9 /htdocs/wp-content/plugins/elementor/includes/plugin.php(685): do_action('elementor/init') #10 /htdocs/wp-includes/class-wp-hook.php(324): Elementor\Plugin->init('') #11 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #12 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #13 /htdocs/wp-settings.php(704): do_action('init') #14 /htdocs/wp-config.php(98): require_once('/htdocs/wp-sett...') #15 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #16 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #17 /htdocs/index.php(17): require('/htdocs/wp-blog...') #18 {main} thrown in /htdocs/wp-content/plugins/elementor/data/manager.php on line 88