'No data provided' ) ); } // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing $body = json_decode( stripslashes( $_POST['data'] ), true ); foreach ( $body as $key => $value ) { if ( strpos( $key, '[]' ) !== false ) { unset( $body[ $key ] ); $new_key = str_replace( '[]', '', $key ); $body[ $new_key ] = is_array( $value ) ? $value : array( $value ); } } $result = Validation_Handler::validate( $body ); wp_send_json( $result ); } }