| @@ -17,8 +17,10 @@ | ||
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | class Module extends Module_Base { |
| 20 | 20 | |
| 21 | + const DEFAULT_SUBJECT = 'Editor Feedback'; | |
| 22 | + | |
| 21 | 23 | public function __construct() { |
| 22 | 24 | add_action( 'rest_api_init', fn() => self::register_routes() ); |
| 23 | 25 | } |
| 24 | 26 | |
| @@ -32,13 +34,14 @@ | ||
| 32 | 34 | |
| 33 | 35 | protected function handle_submit( $request, $additional_cookies = [] ) { |
| 34 | 36 | $user_meta = get_user_meta( get_current_user_id(), 'wp_elementor_connect_common_data' ); |
| 35 | 37 | $app = Plugin::$instance->common->get_component( 'connect' )->get_app( 'feedback' ); |
| 38 | + $subject = sanitize_text_field( $request->get_param( 'subject' ) ); | |
| 36 | 39 | $body = [ |
| 37 | 40 | 'title' => 'Editor Feedback', |
| 38 | 41 | 'description' => $request->get_param( 'description' ), |
| 39 | 42 | 'product' => 'EDITOR', |
| 40 | - 'subject' => 'Editor Feedback', | |
| 43 | + 'subject' => $subject ? $subject : self::DEFAULT_SUBJECT, | |
| 41 | 44 | ]; |
| 42 | 45 | |
| 43 | 46 | $response = $app->submit( $body ); |
| 44 | 47 | $response_code = $response['response']['code']; |