oint_args_for_item_schema( WP_REST_Server::EDITABLE ), ), array( 'methods' => WP_REST_Server::DELETABLE, 'callback' => array( $this, 'delete_current_item' ), 'permission_callback' => array( $this, 'delete_current_item_permissions_check' ), 'args' => array( 'force' => array( 'type' => 'boolean', 'default' => false, 'description' => __( 'Required to be true, as users do not support trashing.' ), ), 'reassign' => array( 'type' => 'integer', 'description' => __( 'Reassign the deleted user\'s posts and links to this user ID.' ), 'required' => true, 'sanitize_callback' => array( $this, 'check_reassign' ), ), ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Checks for a valid value for the reassign parameter when deleting users. * * The value can be an integer, 'false', false, or ''. * * @since 4.7.0 * * @param int|bool $value The value passed to the reassign parameter. * @param WP_REST_Request $request Full details about the request. * @param string $param The parameter that is being sanitized. * @return int|bool|WP_Error */ public function check_reassign( $value, $request, $param ) { if ( is_numeric( $value ) ) { return $value; } if ( empty( $value ) || false === $value || 'false' === $value ) { return false; } return new WP_Error( 'rest_invalid_param', __( 'Invalid user parameter(s).' ), array( 'status' => 400 ) ); } /** * Permissions check for getting all users. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, otherwise WP_Error object. */ public function get_items_permissions_check( $request ) { // Check if roles is specified in GET request and if user can list users. if ( ! empty( $request['roles'] ) && ! current_user_can( 'list_users' ) ) { return new WP_Error( 'rest_user_cannot_view', __( 'Sorry, you are not allowed to filter users by role.' ), array( 'status' => rest_authorization_required_code() ) ); } // Check if capabilities is specified in GET request and if user can list users. if ( ! empty( $request['capabilities'] ) && ! current_user_can( 'list_users' ) ) { return new WP_Error( 'rest_user_cannot_view', __( 'Sorry, you are not allowed to filter users by capability.' ), array( 'status' => rest_authorization_required_code() ) ); } if ( 'edit' === $request['context'] && ! current_user_can( 'list_users' ) ) { return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit users.' ), array( 'status' => rest_authorization_required_code() ) ); } if ( in_array( $request['orderby'], array( 'email', 'registered_date' ), true ) && ! current_user_can( 'list_users' ) ) { return new WP_Error( 'rest_forbidden_orderby', __( 'Sorry, you are not allowed to order users by this parameter.' ), array( 'status' => rest_authorization_required_code() ) ); } if ( 'authors' === $request['who'] ) { $types = get_post_types( array( 'show_in_rest' => true ), 'objects' ); foreach ( $types as $type ) { if ( post_type_supports( $type->name, 'author' ) && current_user_can( $type->cap->edit_posts ) ) { return true; } } return new WP_Error( 'rest_forbidden_who', __( 'Sorry, you are not allowed to query users by this parameter.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Retrieves all users. * * @since 4.7.0 * @since 6.8.0 Added support for the search_columns query param. * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_items( $request ) { // Retrieve the list of registered collection query parameters. $registered = $this->get_collection_params(); /* * This array defines mappings between public API query parameters whose * values are accepted as-passed, and their internal WP_Query parameter * name equivalents (some are the same). Only values which are also * present in $registered will be set. */ $parameter_mappings = array( 'exclude' => 'exclude', 'include' => 'include', 'order' => 'order', 'per_page' => 'number', 'search' => 'search', 'roles' => 'role__in', 'capabilities' => 'capability__in', 'slug' => 'nicename__in', ); $prepared_args = array(); /* * For each known parameter which is both registered and present in the request, * set the parameter's value on the query $prepared_args. */ foreach ( $parameter_mappings as $api_param => $wp_param ) { if ( isset( $registered[ $api_param ], $request[ $api_param ] ) ) { $prepared_args[ $wp_param ] = $request[ $api_param ]; } } if ( isset( $registered['offset'] ) && ! empty( $request['offset'] ) ) { $prepared_args['offset'] = $request['offset']; } else { $prepared_args['offset'] = ( $request['page'] - 1 ) * $prepared_args['number']; } if ( isset( $registered['orderby'] ) ) { $orderby_possibles = array( 'id' => 'ID', 'include' => 'include', 'name' => 'display_name', 'registered_date' => 'registered', 'slug' => 'user_nicename', 'include_slugs' => 'nicename__in', 'email' => 'user_email', 'url' => 'user_url', ); $prepared_args['orderby'] = $orderby_possibles[ $request['orderby'] ]; } if ( isset( $registered['who'] ) && ! empty( $request['who'] ) && 'authors' === $request['who'] ) { $prepared_args['who'] = 'authors'; } elseif ( ! current_user_can( 'list_users' ) ) { $prepared_args['has_published_posts'] = get_post_types( array( 'show_in_rest' => true ), 'names' ); } if ( ! empty( $request['has_published_posts'] ) ) { $prepared_args['has_published_posts'] = ( true === $request['has_published_posts'] ) ? get_post_types( array( 'show_in_rest' => true ), 'names' ) : (array) $request['has_published_posts']; } if ( ! empty( $prepared_args['search'] ) ) { if ( ! current_user_can( 'list_users' ) ) { $prepared_args['search_columns'] = array( 'ID', 'user_login', 'user_nicename', 'display_name' ); } $search_columns = $request->get_param( 'search_columns' ); $valid_columns = isset( $prepared_args['search_columns'] ) ? $prepared_args['search_columns'] : array( 'ID', 'user_login', 'user_nicename', 'user_email', 'display_name' ); $search_columns_mapping = array( 'id' => 'ID', 'username' => 'user_login', 'slug' => 'user_nicename', 'email' => 'user_email', 'name' => 'display_name', ); $search_columns = array_map( static function ( $column ) use ( $search_columns_mapping ) { return $search_columns_mapping[ $column ]; }, $search_columns ); $search_columns = array_intersect( $search_columns, $valid_columns ); if ( ! empty( $search_columns ) ) { $prepared_args['search_columns'] = $search_columns; } $prepared_args['search'] = '*' . $prepared_args['search'] . '*'; } $is_head_request = $request->is_method( 'HEAD' ); if ( $is_head_request ) { // Force the 'fields' argument. For HEAD requests, only user IDs are required. $prepared_args['fields'] = 'id'; } /** * Filters WP_User_Query arguments when querying users via the REST API. * * @link https://developer.wordpress.org/reference/classes/wp_user_query/ * * @since 4.7.0 * * @param array $prepared_args Array of arguments for WP_User_Query. * @param WP_REST_Request $request The REST API request. */ $prepared_args = apply_filters( 'rest_user_query', $prepared_args, $request ); $query = new WP_User_Query( $prepared_args ); if ( ! $is_head_request ) { $users = array(); foreach ( $query->get_results() as $user ) { if ( 'edit' === $request['context'] && ! current_user_can( 'edit_user', $user->ID ) ) { continue; } $data = $this->prepare_item_for_response( $user, $request ); $users[] = $this->prepare_response_for_collection( $data ); } } $response = $is_head_request ? new WP_REST_Response( array() ) : rest_ensure_response( $users ); // Store pagination values for headers then unset for count query. $per_page = (int) $prepared_args['number']; $page = (int) ceil( ( ( (int) $prepared_args['offset'] ) / $per_page ) + 1 ); $prepared_args['fields'] = 'ID'; $total_users = $query->get_total(); if ( $total_users < 1 ) { // Out-of-bounds, run the query without pagination/offset to get the total count. unset( $prepared_args['number'], $prepared_args['offset'] ); $prepared_args['number'] = 1; $prepared_args['fields'] = 'ID'; $count_query = new WP_User_Query( $prepared_args ); $total_users = $count_query->get_total(); } $response->header( 'X-WP-Total', (int) $total_users ); $max_pages = (int) ceil( $total_users / $per_page ); $response->header( 'X-WP-TotalPages', $max_pages ); $base = add_query_arg( urlencode_deep( $request->get_query_params() ), rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ) ); if ( $page > 1 ) { $prev_page = $page - 1; if ( $prev_page > $max_pages ) { $prev_page = $max_pages; } $prev_link = add_query_arg( 'page', $prev_page, $base ); $response->link_header( 'prev', $prev_link ); } if ( $max_pages > $page ) { $next_page = $page + 1; $next_link = add_query_arg( 'page', $next_page, $base ); $response->link_header( 'next', $next_link ); } return $response; } /** * Get the user, if the ID is valid. * * @since 4.7.2 * * @param int $id Supplied ID. * @return WP_User|WP_Error True if ID is valid, WP_Error otherwise. */ protected function get_user( $id ) { $error = new WP_Error( 'rest_user_invalid_id', __( 'Invalid user ID.' ), array( 'status' => 404 ) ); if ( (int) $id <= 0 ) { return $error; } $user = get_userdata( (int) $id ); if ( empty( $user ) || ! $user->exists() ) { return $error; } if ( is_multisite() && ! is_user_member_of_blog( $user->ID ) ) { return $error; } return $user; } /** * Checks if a given request has access to read a user. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access for the item, otherwise WP_Error object. */ public function get_item_permissions_check( $request ) { $user = $this->get_user( $request['id'] ); if ( is_wp_error( $user ) ) { return $user; } $types = get_post_types( array( 'show_in_rest' => true ), 'names' ); if ( get_current_user_id() === $user->ID ) { return true; } if ( 'edit' === $request['context'] && ! current_user_can( 'edit_user', $user->ID ) ) { return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit this user.' ), array( 'status' => rest_authorization_required_code() ) ); } if ( ! current_user_can( 'edit_user', $user->ID ) && ! current_user_can( 'list_users' ) && ! count_user_posts( $user->ID, $types ) ) { return new WP_Error( 'rest_user_cannot_view', __( 'Sorry, you are not allowed to list users.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Retrieves a single user. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_item( $request ) { $user = $this->get_user( $request['id'] ); if ( is_wp_error( $user ) ) { return $user; } $user = $this->prepare_item_for_response( $user, $request ); $response = rest_ensure_response( $user ); return $response; } /** * Retrieves the current user. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_current_item( $request ) { $current_user_id = get_current_user_id(); if ( empty( $current_user_id ) ) { return new WP_Error( 'rest_not_logged_in', __( 'You are not currently logged in.' ), array( 'status' => 401 ) ); } $user = wp_get_current_user(); $response = $this->prepare_item_for_response( $user, $request ); $response = rest_ensure_response( $response ); return $response; } /** * Checks if a given request has access create users. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to create items, WP_Error object otherwise. */ public function create_item_permissions_check( $request ) { if ( ! current_user_can( 'create_users' ) ) { return new WP_Error( 'rest_cannot_create_user', __( 'Sorry, you are not allowed to create new users.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Creates a single user. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function create_item( $request ) { if ( ! empty( $request['id'] ) ) { return new WP_Error( 'rest_user_exists', __( 'Cannot create existing user.' ), array( 'status' => 400 ) ); } $schema = $this->get_item_schema(); if ( ! empty( $request['roles'] ) && ! empty( $schema['properties']['roles'] ) ) { $check_permission = $this->check_role_update( $request['id'], $request['roles'] ); if ( is_wp_error( $check_permission ) ) { return $check_permission; } } $user = $this->prepare_item_for_database( $request ); if ( is_multisite() ) { $ret = wpmu_validate_user_signup( $user->user_login, $user->user_email ); if ( is_wp_error( $ret['errors'] ) && $ret['errors']->has_errors() ) { $error = new WP_Error( 'rest_invalid_param', __( 'Invalid user parameter(s).' ), array( 'status' => 400 ) ); foreach ( $ret['errors']->errors as $code => $messages ) { foreach ( $messages as $message ) { $error->add( $code, $message ); } $error_data = $error->get_error_data( $code ); if ( $error_data ) { $error->add_data( $error_data, $code ); } } return $error; } } if ( is_multisite() ) { $user_id = wpmu_create_user( $user->user_login, $user->user_pass, $user->user_email ); if ( ! $user_id ) { return new WP_Error( 'rest_user_create', __( 'Error creating new user.' ), array( 'status' => 500 ) ); } $user->ID = $user_id; $user_id = wp_update_user( wp_slash( (array) $user ) ); if ( is_wp_error( $user_id ) ) { return $user_id; } $result = add_user_to_blog( get_site()->id, $user_id, '' ); if ( is_wp_error( $result ) ) { return $result; } } else { $user_id = wp_insert_user( wp_slash( (array) $user ) ); if ( is_wp_error( $user_id ) ) { return $user_id; } } $user = get_user_by( 'id', $user_id ); /** * Fires immediately after a user is created or updated via the REST API. * * @since 4.7.0 * * @param WP_User $user Inserted or updated user object. * @param WP_REST_Request $request Request object. * @param bool $creating True when creating a user, false when updating. */ do_action( 'rest_insert_user', $user, $request, true ); if ( ! empty( $request['roles'] ) && ! empty( $schema['properties']['roles'] ) ) { array_map( array( $user, 'add_role' ), $request['roles'] ); } if ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) { $meta_update = $this->meta->update_value( $request['meta'], $user_id ); if ( is_wp_error( $meta_update ) ) { return $meta_update; } } $user = get_user_by( 'id', $user_id ); $fields_update = $this->update_additional_fields_for_object( $user, $request ); if ( is_wp_error( $fields_update ) ) { return $fields_update; } $request->set_param( 'context', 'edit' ); /** * Fires after a user is completely created or updated via the REST API. * * @since 5.0.0 * * @param WP_User $user Inserted or updated user object. * @param WP_REST_Request $request Request object. * @param bool $creating True when creating a user, false when updating. */ do_action( 'rest_after_insert_user', $user, $request, true ); $response = $this->prepare_item_for_response( $user, $request ); $response = rest_ensure_response( $response ); $response->set_status( 201 ); $response->header( 'Location', rest_url( sprintf( '%s/%s/%d', $this->namespace, $this->rest_base, $user_id ) ) ); return $response; } /** * Checks if a given request has access to update a user. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to update the item, WP_Error object otherwise. */ public function update_item_permissions_check( $request ) { $user = $this->get_user( $request['id'] ); if ( is_wp_error( $user ) ) { return $user; } if ( ! empty( $request['roles'] ) ) { if ( ! current_user_can( 'promote_user', $user->ID ) ) { return new WP_Error( 'rest_cannot_edit_roles', __( 'Sorry, you are not allowed to edit roles of this user.' ), array( 'status' => rest_authorization_required_code() ) ); } $request_params = array_keys( $request->get_params() ); sort( $request_params ); /* * If only 'id' and 'roles' are specified (we are only trying to * edit roles), then only the 'promote_user' cap is required. */ if ( array( 'id', 'roles' ) === $request_params ) { return true; } } if ( ! current_user_can( 'edit_user', $user->ID ) ) { return new WP_Error( 'rest_cannot_edit', __( 'Sorry, you are not allowed to edit this user.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Updates a single user. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function update_item( $request ) { $user = $this->get_user( $request['id'] ); if ( is_wp_error( $user ) ) { return $user; } $id = $user->ID; $owner_id = false; if ( is_string( $request['email'] ) ) { $owner_id = email_exists( $request['email'] ); } if ( $owner_id && $owner_id !== $id ) { return new WP_Error( 'rest_user_invalid_email', __( 'Invalid email address.' ), array( 'status' => 400 ) ); } if ( ! empty( $request['username'] ) && $request['username'] !== $user->user_login ) { return new WP_Error( 'rest_user_invalid_argument', __( 'Username is not editable.' ), array( 'status' => 400 ) ); } if ( ! empty( $request['slug'] ) && $request['slug'] !== $user->user_nicename && get_user_by( 'slug', $request['slug'] ) ) { return new WP_Error( 'rest_user_invalid_slug', __( 'Invalid slug.' ), array( 'status' => 400 ) ); } if ( ! empty( $request['roles'] ) ) { $check_permission = $this->check_role_update( $id, $request['roles'] ); if ( is_wp_error( $check_permission ) ) { return $check_permission; } } $user = $this->prepare_item_for_database( $request ); // Ensure we're operating on the same user we already checked. $user->ID = $id; $user_id = wp_update_user( wp_slash( (array) $user ) ); if ( is_wp_error( $user_id ) ) { return $user_id; } $user = get_user_by( 'id', $user_id ); /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php */ do_action( 'rest_insert_user', $user, $request, false ); if ( ! empty( $request['roles'] ) ) { array_map( array( $user, 'add_role' ), $request['roles'] ); } $schema = $this->get_item_schema(); if ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) { $meta_update = $this->meta->update_value( $request['meta'], $id ); if ( is_wp_error( $meta_update ) ) { return $meta_update; } } $user = get_user_by( 'id', $user_id ); $fields_update = $this->update_additional_fields_for_object( $user, $request ); if ( is_wp_error( $fields_update ) ) { return $fields_update; } $request->set_param( 'context', 'edit' ); /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php */ do_action( 'rest_after_insert_user', $user, $request, false ); $response = $this->prepare_item_for_response( $user, $request ); $response = rest_ensure_response( $response ); return $response; } /** * Checks if a given request has access to update the current user. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to update the item, WP_Error object otherwise. */ public function update_current_item_permissions_check( $request ) { $request['id'] = get_current_user_id(); return $this->update_item_permissions_check( $request ); } /** * Updates the current user. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function update_current_item( $request ) { $request['id'] = get_current_user_id(); return $this->update_item( $request ); } /** * Checks if a given request has access delete a user. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to delete the item, WP_Error object otherwise. */ public function delete_item_permissions_check( $request ) { $user = $this->get_user( $request['id'] ); if ( is_wp_error( $user ) ) { return $user; } if ( ! current_user_can( 'delete_user', $user->ID ) ) { return new WP_Error( 'rest_user_cannot_delete', __( 'Sorry, you are not allowed to delete this user.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Deletes a single user. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function delete_item( $request ) { // We don't support delete requests in multisite. if ( is_multisite() ) { return new WP_Error( 'rest_cannot_delete', __( 'The user cannot be deleted.' ), array( 'status' => 501 ) ); } $user = $this->get_user( $request['id'] ); if ( is_wp_error( $user ) ) { return $user; } $id = $user->ID; $reassign = false === $request['reassign'] ? null : absint( $request['reassign'] ); $force = isset( $request['force'] ) ? (bool) $request['force'] : false; // We don't support trashing for users. if ( ! $force ) { return new WP_Error( 'rest_trash_not_supported', /* translators: %s: force=true */ sprintf( __( "Users do not support trashing. Set '%s' to delete." ), 'force=true' ), array( 'status' => 501 ) ); } if ( ! empty( $reassign ) ) { if ( $reassign === $id || ! get_userdata( $reassign ) ) { return new WP_Error( 'rest_user_invalid_reassign', __( 'Invalid user ID for reassignment.' ), array( 'status' => 400 ) ); } } $request->set_param( 'context', 'edit' ); $previous = $this->prepare_item_for_response( $user, $request ); // Include user admin functions to get access to wp_delete_user(). require_once ABSPATH . 'wp-admin/includes/user.php'; $result = wp_delete_user( $id, $reassign ); if ( ! $result ) { return new WP_Error( 'rest_cannot_delete', __( 'The user cannot be deleted.' ), array( 'status' => 500 ) ); } $response = new WP_REST_Response(); $response->set_data( array( 'deleted' => true, 'previous' => $previous->get_data(), ) ); /** * Fires immediately after a user is deleted via the REST API. * * @since 4.7.0 * * @param WP_User $user The user data. * @param WP_REST_Response $response The response returned from the API. * @param WP_REST_Request $request The request sent to the API. */ do_action( 'rest_delete_user', $user, $response, $request ); return $response; } /** * Checks if a given request has access to delete the current user. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to delete the item, WP_Error object otherwise. */ public function delete_current_item_permissions_check( $request ) { $request['id'] = get_current_user_id(); return $this->delete_item_permissions_check( $request ); } /** * Deletes the current user. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function delete_current_item( $request ) { $request['id'] = get_current_user_id(); return $this->delete_item( $request ); } /** * Prepares a single user output for response. * * @since 4.7.0 * @since 5.9.0 Renamed `$user` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_User $item User object. * @param WP_REST_Request $request Request object. * @return WP_REST_Response Response object. */ public function prepare_item_for_response( $item, $request ) { // Restores the more descriptive, specific name for use within this method. $user = $item; // Don't prepare the response body for HEAD requests. if ( $request->is_method( 'HEAD' ) ) { /** This filter is documented in wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php */ return apply_filters( 'rest_prepare_user', new WP_REST_Response( array() ), $user, $request ); } $fields = $this->get_fields_for_response( $request ); $data = array(); if ( in_array( 'id', $fields, true ) ) { $data['id'] = $user->ID; } if ( in_array( 'username', $fields, true ) ) { $data['username'] = $user->user_login; } if ( in_array( 'name', $fields, true ) ) { $data['name'] = $user->display_name; } if ( in_array( 'first_name', $fields, true ) ) { $data['first_name'] = $user->first_name; } if ( in_array( 'last_name', $fields, true ) ) { $data['last_name'] = $user->last_name; } if ( in_array( 'email', $fields, true ) ) { $data['email'] = $user->user_email; } if ( in_array( 'url', $fields, true ) ) { $data['url'] = $user->user_url; } if ( in_array( 'description', $fields, true ) ) { $data['description'] = $user->description; } if ( in_array( 'link', $fields, true ) ) { $data['link'] = get_author_posts_url( $user->ID, $user->user_nicename ); } if ( in_array( 'locale', $fields, true ) ) { $data['locale'] = get_user_locale( $user ); } if ( in_array( 'nickname', $fields, true ) ) { $data['nickname'] = $user->nickname; } if ( in_array( 'slug', $fields, true ) ) { $data['slug'] = $user->user_nicename; } if ( in_array( 'roles', $fields, true ) && ( current_user_can( 'list_users' ) || current_user_can( 'edit_user', $user->ID ) ) ) { // Defensively call array_values() to ensure an array is returned. $data['roles'] = array_values( $user->roles ); } if ( in_array( 'registered_date', $fields, true ) ) { $data['registered_date'] = gmdate( 'c', strtotime( $user->user_registered ) ); } if ( in_array( 'capabilities', $fields, true ) ) { $data['capabilities'] = (object) $user->allcaps; } if ( in_array( 'extra_capabilities', $fields, true ) ) { $data['extra_capabilities'] = (object) $user->caps; } if ( in_array( 'avatar_urls', $fields, true ) ) { $data['avatar_urls'] = rest_get_avatar_urls( $user ); } if ( in_array( 'meta', $fields, true ) ) { $data['meta'] = $this->meta->get_value( $user->ID, $request ); } $context = ! empty( $request['context'] ) ? $request['context'] : 'embed'; $data = $this->add_additional_fields_to_object( $data, $request ); $data = $this->filter_response_by_context( $data, $context ); // Wrap the data in a response object. $response = rest_ensure_response( $data ); if ( rest_is_field_included( '_links', $fields ) || rest_is_field_included( '_embedded', $fields ) ) { $response->add_links( $this->prepare_links( $user ) ); } /** * Filters user data returned from the REST API. * * @since 4.7.0 * * @param WP_REST_Response $response The response object. * @param WP_User $user User object used to create response. * @param WP_REST_Request $request Request object. */ return apply_filters( 'rest_prepare_user', $response, $user, $request ); } /** * Prepares links for the user request. * * @since 4.7.0 * * @param WP_User $user User object. * @return array Links for the given user. */ protected function prepare_links( $user ) { $links = array( 'self' => array( 'href' => rest_url( sprintf( '%s/%s/%d', $this->namespace, $this->rest_base, $user->ID ) ), ), 'collection' => array( 'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ), ), ); return $links; } /** * Prepares a single user for creation or update. * * @since 4.7.0 * * @param WP_REST_Request $request Request object. * @return object User object. */ protected function prepare_item_for_database( $request ) { $prepared_user = new stdClass(); $schema = $this->get_item_schema(); // Required arguments. if ( isset( $request['email'] ) && ! empty( $schema['properties']['email'] ) ) { $prepared_user->user_email = $request['email']; } if ( isset( $request['username'] ) && ! empty( $schema['properties']['username'] ) ) { $prepared_user->user_login = $request['username']; } if ( isset( $request['password'] ) && ! empty( $schema['properties']['password'] ) ) { $prepared_user->user_pass = $request['password']; } // Optional arguments. if ( isset( $request['id'] ) ) { $prepared_user->ID = absint( $request['id'] ); } if ( isset( $request['name'] ) && ! empty( $schema['properties']['name'] ) ) { $prepared_user->display_name = $request['name']; } if ( isset( $request['first_name'] ) && ! empty( $schema['properties']['first_name'] ) ) { $prepared_user->first_name = $request['first_name']; } if ( isset( $request['last_name'] ) && ! empty( $schema['properties']['last_name'] ) ) { $prepared_user->last_name = $request['last_name']; } if ( isset( $request['nickname'] ) && ! empty( $schema['properties']['nickname'] ) ) { $prepared_user->nickname = $request['nickname']; } if ( isset( $request['slug'] ) && ! empty( $schema['properties']['slug'] ) ) { $prepared_user->user_nicename = $request['slug']; } if ( isset( $request['description'] ) && ! empty( $schema['properties']['description'] ) ) { $prepared_user->description = $request['description']; } if ( isset( $request['url'] ) && ! empty( $schema['properties']['url'] ) ) { $prepared_user->user_url = $request['url']; } if ( isset( $request['locale'] ) && ! empty( $schema['properties']['locale'] ) ) { $prepared_user->locale = $request['locale']; } // Setting roles will be handled outside of this function. if ( isset( $request['roles'] ) ) { $prepared_user->role = false; } /** * Filters user data before insertion via the REST API. * * @since 4.7.0 * * @param object $prepared_user User object. * @param WP_REST_Request $request Request object. */ return apply_filters( 'rest_pre_insert_user', $prepared_user, $request ); } /** * Determines if the current user is allowed to make the desired roles change. * * @since 4.7.0 * * @global WP_Roles $wp_roles WordPress role management object. * * @param int $user_id User ID. * @param array $roles New user roles. * @return true|WP_Error True if the current user is allowed to make the role change, * otherwise a WP_Error object. */ protected function check_role_update( $user_id, $roles ) { global $wp_roles; foreach ( $roles as $role ) { if ( ! isset( $wp_roles->role_objects[ $role ] ) ) { return new WP_Error( 'rest_user_invalid_role', /* translators: %s: Role key. */ sprintf( __( 'The role %s does not exist.' ), $role ), array( 'status' => 400 ) ); } $potential_role = $wp_roles->role_objects[ $role ]; /* * Don't let anyone with 'edit_users' (admins) edit their own role to something without it. * Multisite super admins can freely edit their blog roles -- they possess all caps. */ if ( ! ( is_multisite() && current_user_can( 'manage_sites' ) ) && get_current_user_id() === $user_id && ! $potential_role->has_cap( 'edit_users' ) ) { return new WP_Error( 'rest_user_invalid_role', __( 'Sorry, you are not allowed to give users that role.' ), array( 'status' => rest_authorization_required_code() ) ); } // Include user admin functions to get access to get_editable_roles(). require_once ABSPATH . 'wp-admin/includes/user.php'; // The new role must be editable by the logged-in user. $editable_roles = get_editable_roles(); if ( empty( $editable_roles[ $role ] ) ) { return new WP_Error( 'rest_user_invalid_role', __( 'Sorry, you are not allowed to give users that role.' ), array( 'status' => 403 ) ); } } return true; } /** * Check a username for the REST API. * * Performs a couple of checks like edit_user() in wp-admin/includes/user.php. * * @since 4.7.0 * * @param string $value The username submitted in the request. * @param WP_REST_Request $request Full details about the request. * @param string $param The parameter name. * @return string|WP_Error The sanitized username, if valid, otherwise an error. */ public function check_username( $value, $request, $param ) { $username = (string) $value; if ( ! validate_username( $username ) ) { return new WP_Error( 'rest_user_invalid_username', __( 'This username is invalid because it uses illegal characters. Please enter a valid username.' ), array( 'status' => 400 ) ); } /** This filter is documented in wp-includes/user.php */ $illegal_logins = (array) apply_filters( 'illegal_user_logins', array() ); if ( in_array( strtolower( $username ), array_map( 'strtolower', $illegal_logins ), true ) ) { return new WP_Error( 'rest_user_invalid_username', __( 'Sorry, that username is not allowed.' ), array( 'status' => 400 ) ); } return $username; } /** * Check a user password for the REST API. * * Performs a couple of checks like edit_user() in wp-admin/includes/user.php. * * @since 4.7.0 * * @param string $value The password submitted in the request. * @param WP_REST_Request $request Full details about the request. * @param string $param The parameter name. * @return string|WP_Error The sanitized password, if valid, otherwise an error. */ public function check_user_password( #[\SensitiveParameter] $value, $request, $param ) { $password = (string) $value; if ( empty( $password ) ) { return new WP_Error( 'rest_user_invalid_password', __( 'Passwords cannot be empty.' ), array( 'status' => 400 ) ); } if ( str_contains( $password, '\\' ) ) { return new WP_Error( 'rest_user_invalid_password', sprintf( /* translators: %s: The '\' character. */ __( 'Passwords cannot contain the "%s" character.' ), '\\' ), array( 'status' => 400 ) ); } return $password; } /** * Retrieves the user's schema, conforming to JSON Schema. * * @since 4.7.0 * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'user', 'type' => 'object', 'properties' => array( 'id' => array( 'description' => __( 'Unique identifier for the user.' ), 'type' => 'integer', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'username' => array( 'description' => __( 'Login name for the user.' ), 'type' => 'string', 'context' => array( 'edit' ), 'required' => true, 'arg_options' => array( 'sanitize_callback' => array( $this, 'check_username' ), ), ), 'name' => array( 'description' => __( 'Display name for the user.' ), 'type' => 'string', 'context' => array( 'embed', 'view', 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ), 'first_name' => array( 'description' => __( 'First name for the user.' ), 'type' => 'string', 'context' => array( 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ), 'last_name' => array( 'description' => __( 'Last name for the user.' ), 'type' => 'string', 'context' => array( 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ), 'email' => array( 'description' => __( 'The email address for the user.' ), 'type' => 'string', 'format' => 'email', 'context' => array( 'edit' ), 'required' => true, ), 'url' => array( 'description' => __( 'URL of the user.' ), 'type' => 'string', 'format' => 'uri', 'context' => array( 'embed', 'view', 'edit' ), ), 'description' => array( 'description' => __( 'Description of the user.' ), 'type' => 'string', 'context' => array( 'embed', 'view', 'edit' ), ), 'link' => array( 'description' => __( 'Author URL of the user.' ), 'type' => 'string', 'format' => 'uri', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'locale' => array( 'description' => __( 'Locale for the user.' ), 'type' => 'string', 'enum' => array_merge( array( '', 'en_US' ), get_available_languages() ), 'context' => array( 'edit' ), ), 'nickname' => array( 'description' => __( 'The nickname for the user.' ), 'type' => 'string', 'context' => array( 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ), 'slug' => array( 'description' => __( 'An alphanumeric identifier for the user.' ), 'type' => 'string', 'context' => array( 'embed', 'view', 'edit' ), 'arg_options' => array( 'sanitize_callback' => array( $this, 'sanitize_slug' ), ), ), 'registered_date' => array( 'description' => __( 'Registration date for the user.' ), 'type' => 'string', 'format' => 'date-time', 'context' => array( 'edit' ), 'readonly' => true, ), 'roles' => array( 'description' => __( 'Roles assigned to the user.' ), 'type' => 'array', 'items' => array( 'type' => 'string', ), 'context' => array( 'edit' ), ), 'password' => array( 'description' => __( 'Password for the user (never included).' ), 'type' => 'string', 'context' => array(), // Password is never displayed. 'required' => true, 'arg_options' => array( 'sanitize_callback' => array( $this, 'check_user_password' ), ), ), 'capabilities' => array( 'description' => __( 'All capabilities assigned to the user.' ), 'type' => 'object', 'context' => array( 'edit' ), 'readonly' => true, ), 'extra_capabilities' => array( 'description' => __( 'Any extra capabilities assigned to the user.' ), 'type' => 'object', 'context' => array( 'edit' ), 'readonly' => true, ), ), ); if ( get_option( 'show_avatars' ) ) { $avatar_properties = array(); $avatar_sizes = rest_get_avatar_sizes(); foreach ( $avatar_sizes as $size ) { $avatar_properties[ $size ] = array( /* translators: %d: Avatar image size in pixels. */ 'description' => sprintf( __( 'Avatar URL with image size of %d pixels.' ), $size ), 'type' => 'string', 'format' => 'uri', 'context' => array( 'embed', 'view', 'edit' ), ); } $schema['properties']['avatar_urls'] = array( 'description' => __( 'Avatar URLs for the user.' ), 'type' => 'object', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, 'properties' => $avatar_properties, ); } $schema['properties']['meta'] = $this->meta->get_field_schema(); $this->schema = $schema; return $this->add_additional_fields_schema( $this->schema ); } /** * Retrieves the query params for collections. * * @since 4.7.0 * * @return array Collection parameters. */ public function get_collection_params() { $query_params = parent::get_collection_params(); $query_params['context']['default'] = 'view'; $query_params['exclude'] = array( 'description' => __( 'Ensure result set excludes specific IDs.' ), 'type' => 'array', 'items' => array( 'type' => 'integer', ), 'default' => array(), ); $query_params['include'] = array( 'description' => __( 'Limit result set to specific IDs.' ), 'type' => 'array', 'items' => array( 'type' => 'integer', ), 'default' => array(), ); $query_params['offset'] = array( 'description' => __( 'Offset the result set by a specific number of items.' ), 'type' => 'integer', ); $query_params['order'] = array( 'default' => 'asc', 'description' => __( 'Order sort attribute ascending or descending.' ), 'enum' => array( 'asc', 'desc' ), 'type' => 'string', ); $query_params['orderby'] = array( 'default' => 'name', 'description' => __( 'Sort collection by user attribute.' ), 'enum' => array( 'id', 'include', 'name', 'registered_date', 'slug', 'include_slugs', 'email', 'url', ), 'type' => 'string', ); $query_params['slug'] = array( 'description' => __( 'Limit result set to users with one or more specific slugs.' ), 'type' => 'array', 'items' => array( 'type' => 'string', ), ); $query_params['roles'] = array( 'description' => __( 'Limit result set to users matching at least one specific role provided. Accepts csv list or single role.' ), 'type' => 'array', 'items' => array( 'type' => 'string', ), ); $query_params['capabilities'] = array( 'description' => __( 'Limit result set to users matching at least one specific capability provided. Accepts csv list or single capability.' ), 'type' => 'array', 'items' => array( 'type' => 'string', ), ); $query_params['who'] = array( 'description' => __( 'Limit result set to users who are considered authors.' ), 'type' => 'string', 'enum' => array( 'authors', ), ); $query_params['has_published_posts'] = array( 'description' => __( 'Limit result set to users who have published posts.' ), 'type' => array( 'boolean', 'array' ), 'items' => array( 'type' => 'string', 'enum' => get_post_types( array( 'show_in_rest' => true ), 'names' ), ), ); $query_params['search_columns'] = array( 'default' => array(), 'description' => __( 'Array of column names to be searched.' ), 'type' => 'array', 'items' => array( 'enum' => array( 'email', 'name', 'id', 'username', 'slug' ), 'type' => 'string', ), ); /** * Filters REST API collection parameters for the users controller. * * This filter registers the collection parameter, but does not map the * collection parameter to an internal WP_User_Query parameter. Use the * `rest_user_query` filter to set WP_User_Query arguments. * * @since 4.7.0 * * @param array $query_params JSON Schema-formatted collection parameters. */ return apply_filters( 'rest_user_collection_params', $query_params ); } } UA27 HD on-screen cable Type-C to HDTV – alibabatelecom
ADD ANYTHING HERE OR JUST REMOVE IT…
  • NEWSLETTER
  • CONTACT US
  • FAQs
alibabatelecom
Select category
  • Select category
  • Accessories
    • Mouse , Keyboard
    • phone card holder
    • Phone holder
    • Pop socket
    • Selfi
    • USB-SD card
  • brands
    • ACEFAST
    • Adidas
    • AMA Book Case
    • AMA Extra pas Book Case
    • Anti shock
      • Iphone
    • Apple
    • Back case card holder
    • back case color
      • Luxury clear magnetic back case
    • BOROFONE
    • Fashion Case
    • Hoco
    • ideal of Sweden
    • KEY Book Case
    • kingston Memory
    • Magnet leather case
    • OG Tempered Glass
    • Samsung
    • selly
  • Childeren toys
    • Car , Motor
  • Electronics
    • Adapters
    • Air Tag
    • Bluetooth Speaker
    • Cables
    • Car adapter , cables
    • Gaming
    • HDMI , converter
    • Headset , audio jack
    • Oudio Other
    • Wirless charger
  • Mobile , Tab , Watch parts
    • Ipad
      • Ipad battery
      • Ipad charging port
      • Ipad display
    • Iphone
      • Iphone back camera
      • Iphone Back cover
      • Iphone battery
      • Iphone camera lens
      • Iphone charging port
      • Iphone display
      • Iphone earspeaker
      • Iphone front camera
      • Iphone loudspeaker
      • iphone parts
      • Iphone Simcard holder
    • Samsung
      • Main Flex
      • Power And Volume Flex Cable
      • Samsung back camera
      • Samsung back cover
      • Samsung battery
      • Samsung camera lens
      • Samsung charging port
      • Samsung display
      • Samsung earspeaker
      • Samsung front camera
      • Samsung LCD Flex
      • Samsung loudspeaker
      • Samsung Signal Antenna
      • Samsung Simcard holder
  • Mobile , Tablets Accessories
    • Apple
      • AirPods
      • Apple Watch
        • Apple watch 3 serie 40mm
        • Apple watch 3 serie 42mm
        • Apple watch 4 serie 38mm
        • Apple watch 4 serie 42mm
        • Apple watch 5 serie 40mm
        • Apple watch 5 serie 44mm
        • Apple watch 6 serie 40mm
        • Apple watch 6 serie 44mm
        • Apple watch 7 serie 41mm
        • Apple watch 7 serie 45mm
        • Apple watch 8 serie 41mm
        • Apple watch 8 serie 45mm
        • Apple watch Ultra 49mm 1st Gen
      • IPad
        • iPad 10.2 7th Ge (2019)
        • iPad 10.2 8th Ge (2020)
        • iPad 10.2 9th Ge (2021)
        • iPad 10.9 (10th 2022)
        • iPad 11 (11Gen 2025 )
        • Ipad 3
        • Ipad 4
        • iPad 9.7 (5th 2017)
        • iPad 9.7 (6th 2018)
        • iPad Air (2013)
        • iPad Air 11 (2024)
        • iPad Air 11 (2025)
        • iPad Air 13 (2024)
        • iPad Air 13 (2025)
        • Ipad Air 2 (2014)
        • iPad Air 3rd Ge (2019)
        • iPad Air 4th Ge (2020)
        • iPad Air 5th Ge (2022)
        • ipad mini 4th Ge (2015)
        • ipad mini 5th Ge (2019)
        • ipad mini 6th Ge (2021)
        • iPad Pro 10.5 (2017)
        • iPad Pro 11 (1Gen 2018)
        • iPad Pro 11 (2 Gen: 2020)
        • iPad Pro 11 (3Gen 2021)
        • iPad Pro 11 (4 Gen: 2022)
        • iPad Pro 11 (5 Gen: 2024) M4
        • iPad Pro 12.9 (1nd 2015)
        • iPad Pro 12.9 (2nd 2017)
        • iPad Pro 12.9 (3nd 2018)
        • iPad Pro 12.9 (4nd 2020)
        • iPad Pro 12.9 (5nd 2021)
        • iPad Pro 12.9 (6nd 2022)
        • IPad Pro 13 (2024)(13-inch (M4)
        • iPad Pro 13 (2025)(13-inch (M5)
        • iPad Pro 9.7 (2016)
      • Iphone
        • iphone 11
        • iphone 11 pro
        • iphone 11 pro max
        • iphone 12
        • iphone 12 mini
        • iphone 12 pro
        • iphone 12 pro max
        • iphone 13
        • iphone 13 mini
        • iphone 13 pro
        • iphone 13 pro max
        • iphone 14
        • iphone 14 plus
        • iphone 14 pro
        • iphone 14 pro max
        • Iphone 15
        • Iphone 15 Plus
        • Iphone 15 Pro
        • Iphone 15 Pro Max
        • Iphone 16
        • Iphone 16 Plus
        • Iphone 16 Pro
        • Iphone 16 Pro Max
        • Iphone 16e
        • Iphone 17
        • Iphone 17 Air
        • Iphone 17 Pro
        • Iphone 17 Pro Max
        • Iphone 17e
        • iphone 5
        • iphone 5S
        • Iphone 6
        • iphone 6 plus
        • iphone 6s
        • iphone 6s plus
        • iphone 7
        • iphone 7 plus
        • iphone 8
        • iphone 8 plus
        • iphone SE
        • iphone SE 2020
        • Iphone SE 2022
        • iphone X
        • iphone XR
        • iphone XS
        • iphone XS max
    • google
      • Google Pixel 5
      • Google Pixel 5A
      • Google Pixel 6
      • Google Pixel 6 Pro
      • Google Pixel 6A
      • Google Pixel 7
      • Google Pixel 7 Pro
      • Google Pixel 7A
      • Google Pixel 8
      • Google Pixel 8 Pro
      • Google Pixel 8A
      • Google Pixel 9
      • Google Pixel 9 Pro
      • Google Pixel 9 Pro XL
    • Huawei
      • Huawei Honor Models
        • Huawei Honor 10
        • Huawei Honor 20
        • Huawei Honor 20 Lite
        • Huawei Honor 20 Pro
        • Huawei Honor 6
        • Huawei Honor 7
        • Huawei Honor 8
        • Huawei Honor 8 Lite
        • Huawei Honor 9
        • Huawei Honor View 10
        • Huawei Honor View 20
      • Huawei Mate Models
        • Huawei Mate 10
        • Huawei Mate 10 Lite
        • Huawei Mate 10 Pro
        • Huawei Mate 20
        • Huawei Mate 20 Lite
        • Huawei Mate 20 Pro
        • Huawei Mate 30
        • Huawei Mate 30 Lite
        • Huawei Mate 30 Pro
        • Huawei Mate 40
        • Huawei Mate 40 Pro
        • Huawei Mate 7
        • Huawei Mate 8
        • Huawei Mate 9
        • Huawei Mate 9 pro
      • Huawei P Models
        • Huawei P10
        • Huawei P10 Lite
        • Huawei P20
        • Huawei P20 Lite
        • Huawei P20 Lite 2019
        • Huawei P20 Pro
        • Huawei P30
        • Huawei P30 Lite
        • Huawei P30 Pro
        • Huawei P40
        • Huawei P40 Lite
        • Huawei P40 pro
        • Huawei P7
        • Huawei P8
        • Huawei P8 Lite
        • Huawei P9
        • Huawei P9 Lite
      • Huawei P smart Models
        • Huawei P smart
        • Huawei P smart 2019
        • Huawei P smart 2020
        • Huawei P smart 2021
        • Huawei P smart pro
        • Huawei P smart Z
    • Nokia
      • HMD Series
        • Nokia 2.4
        • Nokia 5.4
    • Samsung
      • Samsung A model
        • |Samsung A34 (A346)
        • Samsung A01
        • Samsung A02
        • samsung A02s
        • Samsung A03
        • Samsung A03s
        • Samsung A04s
        • Samsung A05S
        • Samsung A06
        • Samsung A07
        • Samsung A10
        • Samsung A10s
        • Samsung A11
        • Samsung A12
        • Samsung A13 4G
        • Samsung A13 5G
        • Samsung A14 4G
        • Samsung A14 5G
        • Samsung A15
        • Samsung A16 4G (A165F)
        • Samsung A16 5G (A166B)
        • Samsung A17
        • Samsung A20e (A202F)
        • Samsung A20s (A207F)
        • Samsung A21 (A215)
        • Samsung A21s (A217F)
        • Samsung A22 4G (A225F)
        • Samsung A22 5G (A226B)
        • Samsung A23 4G (SM-A236)
        • Samsung A23 5G (SM-A236)
        • Samsung A24 (A245F)
        • Samsung A25 (A256)
        • Samsung A26 (A266)
        • Samsung A27
        • Samsung A30 (A305F)
        • Samsung A30s (A307F)
        • Samsung A31 (A315F)
        • Samsung A32 4G (A325)
        • Samsung A32 5G (A326)
        • Samsung A33 5G (A336B)
        • Samsung A35 (A356)
        • Samsung A36 (A366)
        • Samsung A37
        • Samsung A40 (A405F)
        • Samsung A41 (A415F)
        • Samsung A42 (A426B)
        • Samsung A5 2015
        • Samsung A50 (A505F)
        • Samsung A50s
        • Samsung A51 (A515F)
        • Samsung A52 (A525F)
        • Samsung A52s (A528B)
        • Samsung A53 (A536B/DS)
        • Samsung A54 (A546B)
        • Samsung A55 (A556)
        • Samsung A56 (A566)
        • Samsung A60 (A606F)
        • Samsung A70 (A705F)
        • Samsung A71 5G (A716F)
        • Samsung A72 (A725)
        • Samsung A73
        • Samsung A80 (A805F)
        • Samsung A90 (A908F)
      • Samsung Buds case
      • Samsung note model
        • Samsung Note 10
        • Samsung Note 10 Lite
        • Samsung Note 10 plus
        • Samsung Note 20
        • Samsung Note 20 ultra
        • Samsung Note 8
        • Samsung Note 9
      • Samsung S model
        • Samsung s10
        • Samsung S10 lite
        • Samsung s10 plus
        • Samsung s10e
        • Samsung s20
        • Samsung s20 FE
        • Samsung s20 plus
        • Samsung s20 ultra
        • Samsung s21
        • Samsung s21 FE
        • Samsung s21 plus
        • Samsung s21 ultra
        • Samsung s22
        • Samsung s22 plus
        • Samsung s22 ultra
        • Samsung S23
        • Samsung S23 FE
        • Samsung S23 Plus
        • Samsung S23 Ultra
        • Samsung S24
        • Samsung S24 FE
        • Samsung S24 Plus
        • Samsung S24 Ultra
        • Samsung S25
        • Samsung S25 Edge
        • Samsung S25 FE
        • Samsung S25 Plus
        • Samsung S25 Ultra
        • Samsung S26
        • Samsung S26 Edge
        • Samsung S26 FE
        • Samsung S26 Plus
        • Samsung S26 Ultra
        • Samsung s4
        • Samsung s5
        • Samsung s6
        • Samsung s6 edge
        • Samsung s7
        • Samsung s7 edge
        • Samsung s8
        • Samsung s8 plus
        • Samsung s9
        • Samsung s9 plus
      • Samsung X cover model
        • Samsung x cover 3
        • Samsung x cover 4
        • Samsung x cover 4s
        • Samsung x cover 5
        • Samsung x cover 6 pro
        • Samsung X cover 7
        • Samsung x cover pro
      • Samsung Z Fold , Z flip models
        • Samsung Z Flip 3
        • Samsung Z Flip 4
        • Samsung Z Fold 3
        • Samsung Z Fold 4
  • Mobile, tablet , smart watches
    • Mobile
      • Android Mobile
      • IOS Mobile
    • Smart watches
  • Personal care, beauty and well-being
    • Hair dryer
    • Shaving and hair removal
  • Tempered Glass
    • Apple Watch
    • Ipad 3D
    • Iphone camera Lens
    • OG tempered Glass
      • Iphone
      • Samsung
    • Samsung camera lens
    • UV tempered Glass
      • Samsung
Login / Register
0 Wishlist
0 Compare
0 items / 0.00 kr
Menu
alibabatelecom
0 items / 0.00 kr
Browse Categories
  • Mobile, tablet , smart watches
    • Mobile
      • IOS Mobile
      • Android Mobile
      • Doro
    • Tablets
      • Ipad
      • Samsung TAB
    • Smart watches
Browse Categories
  • Apple
    • Iphone
      • Iphone 17 Pro Max
      • Iphone 17 Air
      • Iphone 17 Pro
      • Iphone 17e
      • Iphone 17
      • Iphone 16 Pro Max
      • Iphone 16 Plus
      • Iphone 16 Pro
      • Iphone 16e
      • Iphone 16
      • Iphone 15 Pro Max
      • Iphone 15 Plus
      • Iphone 15 Pro
      • Iphone 15
      • iphone 14 pro max
      • iphone 14 plus
      • iphone 14 pro
      • iphone 14
      • iphone 13 pro max
      • iphone 13 pro
      • iphone 13 mini
      • iphone 13
      • iphone 12 pro max
      • iphone 12 pro
      • iphone 12 mini
      • iphone 12
      • iphone 11 pro max
      • iphone 11 pro
      • iphone 11
      • iphone XS max
      • iphone XR
      • iphone XS
      • iphone X
      • iphone 8 plus
      • iphone 8
      • Iphone SE 2022
      • iphone SE 2020
      • iphone 7 plus
      • iphone 7
      • iphone 6s plus
      • iphone 6s
      • iphone 6 plus
      • Iphone 6
      • iphone SE
      • iphone 5S
      • iphone 5
    • IPad
      • iPad Pro 13 (2025)(13-inch (M5)
      • IPad Pro 13 (2024)(13-inch (M4)
      • iPad Pro 12.9 (6nd 2022)
      • iPad Pro 12.9 (5Gen 2021)
      • iPad Pro 12.9 (4Gen 2020)
      • iPad Pro 12.9 (3Gen 2018)
      • iPad Pro 12.9 (2Gen 2017)
      • iPad Pro 12.9 (1Gen 2015)
      • iPad Pro 11 (5 Gen: 2024) M4
      • iPad Pro 11 (4 Gen: 2022)
      • iPad Pro 11 (3Gen 2021)
      • iPad Pro 11 (2 Gen: 2020)
      • iPad Pro 11 (1Gen 2018)
      • iPad Pro 10.5 (2017)
      • iPad Pro 9.7 (2016)
      • iPad 10.9 (10th 2022)
      • iPad 10.2 9th Ge (2021)
      • iPad 10.2 8th Ge (2020)
      • iPad 10.2 7th Ge (2019)
      • iPad 9.7 (6th 2018)
      • iPad 9.7 (5th 2017)
      • iPad Air 13 (2024)
      • iPad Air 11 (2024) M2
      • iPad Air 5th Ge (2022)
      • iPad Air 4th Ge (2020)
      • iPad Air 3rd Ge (2019)
      • Ipad Air 2 (2014)
      • iPad Air (2013)
      • Ipad 4
      • Ipad 3
      • Ipad 2
      • Ipad mini 7th Ge (2023)
      • ipad mini 6th Ge (2021)
      • ipad mini 5th Ge (2019)
      • ipad mini 4th Ge (2015)
      • ipad mini 3rd Ge (2014)
      • ipad mini 2 (2013)
    • Apple Watch
      • Apple watch Ultra 49mm 2st Gen
      • Apple watch Ultra 49mm 1st Gen
      • Apple watch 9 serie 45mm
      • Apple watch 9 serie 41mm
      • Apple watch 8 serie 45mm
      • Apple watch 8 serie 41mm
      • Apple watch 7 serie 45mm
      • Apple watch 7 serie 41mm
      • Apple watch 6 serie 44mm
      • Apple watch 6 serie 40mm
      • Apple watch SE 2022 serie 44mm
      • Apple watch SE 2022 serie 40mm
      • Apple watch SE serie 44mm
      • Apple watch SE serie 40mm
      • Apple watch 5 serie 44mm
      • Apple watch 5 serie 40mm
      • Apple watch 4 serie 42mm
      • Apple watch 4 serie 38mm
      • Apple watch 3 serie 42mm
      • Apple watch 3 serie 40mm
    • AirPods
      • AirPods Pro (2st generation)
      • AirPods Pro (1st generation)
      • AirPods 4 (4st generation)
      • AirPods 3 (3st generation)
      • AirPods 2 (2st generation)
      • AirPods 1 (1st generation)
Browse Categories
  • Motorola
    • Moto G Models
      • Moto G200
      • Moto G100
      • Moto G85
      • Moto G84
      • Moto G82
      • Moto G75
      • Moto G73
      • Moto G72
      • Moto G71 5G
      • Moto G64
      • Moto G62
      • Moto G60s
      • Moto G60
      • Moto G56
      • Moto G55
      • Moto G54 Power
      • Moto G54
      • Moto G53
      • Moto G52
      • Moto G51 5G
      • Moto G50 5G
      • Moto G50 4G
      • Moto G45
      • Moto G42
      • Moto G41
      • Moto G35
      • Moto G34
      • Moto G32
      • Moto G31
      • Moto G30
      • Moto G24
      • Moto G23
      • Moto G22
      • Moto G20
      • Moto G15
      • Moto G14
      • Moto G13
      • Moto G10 play
      • Moto G10
      • Moto G Power (2021)
    • Moto E Models
      • Moto E40
      • Motorola Moto E32s
      • Motorola Moto E32
      • Motorola Moto E30
      • Motorola Moto E22
      • Motorola Moto E22i
      • Motorola Moto E20
      • Motorola Moto E14
      • Motorola Moto E15
      • Motorola Moto E13
Browse Categories
  • Accessories
    • Mouse , Keyboard
    • touch pen
    • Phone holder
    • phone card holder
    • Pop socket
    • USB-SD card
    • Selfi
Browse Categories
  • Samsung
    • Samsung S model
      • Samsung S25 Ultra
      • Samsung S25 Plus
      • Samsung S25 Edge
      • Samsung S25 FE
      • Samsung S25
      • Samsung S24 Ultra
      • Samsung S24 Plus
      • Samsung S24 FE
      • Samsung S24
      • Samsung S23 Ultra
      • Samsung S23 Plus
      • Samsung S23 FE
      • Samsung S23
      • Samsung s22 ultra
      • Samsung s22 plus
      • Samsung s22
      • Samsung s21 ultra
      • Samsung s21 plus
      • Samsung s21 FE
      • Samsung s21
      • Samsung s20 ultra
      • Samsung s20 plus
      • Samsung s20 FE
      • Samsung s20
      • Samsung s10 plus
      • Samsung S10 lite
      • Samsung s10e
      • Samsung s10
      • Samsung s9 plus
      • Samsung s9
      • Samsung s8 plus
      • Samsung s8
      • Samsung s7 edge
      • Samsung s7
      • Samsung s6 edge
      • Samsung s6
      • Samsung s5
      • Samsung s4
    • Samsung A model,
      • Samsung A90 (A908F)
      • Samsung A80 (A805F)
      • Samsung A73
      • Samsung A50 (A505F)
      • Samsung A72 (A725)
      • Samsung A71 5G (A716F)
      • Samsung A71 (A715F)
      • Samsung A70 (A705F)
      • Samsung A60 (A606F)
      • Samsung A56 (A566)
      • Samsung A55 (A556)
      • Samsung A54 (A546B)
      • Samsung A53 (A536B/DS)
      • Samsung A52s (A528B)
      • Samsung A52 (A525F)
      • Samsung A51 5G (A516B/DS)
      • Samsung A51 (A515F)
      • Samsung A50s
      • Samsung A42 (A426B)
      • Samsung A41 (A415F)
      • Samsung A40 (A405F)
      • Samsung A36 (A366)
      • Samsung A35 (A356)
      • |Samsung A34 (A346)
      • Samsung A33 5G (A336B)
      • Samsung A32 5G (A326)
      • Samsung A32 4G (A325)
      • Samsung A31 (A315F)
      • Samsung A30s (A307F)
      • Samsung A30 (A305F)
      • Samsung A26 (A266)
      • Samsung A25 (A256)
      • Samsung A24 (A245F)
      • Samsung A23 5G (SM-A236)
      • Samsung A23 4G (SM-A236)
      • Samsung A22 5G (A226B)
      • Samsung A22 4G (A225F)
      • Samsung A21s (A217F)
      • Samsung A21 (A215)
      • Samsung A20e (A202F)
      • Samsung A17
      • Samsung A16 5G (A166B)
      • Samsung A16 4G (A165F)
      • Samsung A15
      • Samsung A14 5G
      • Samsung A14 4G
      • Samsung A13 5G
      • Samsung A13 4G
      • Samsung A12
      • Samsung A11
      • Samsung A10s
      • Samsung A10
      • Samsung A07
      • Samsung A06
      • Samsung A05S
      • Samsung A04s
      • Samsung A03s
      • Samsung A03
      • samsung A02s
      • Samsung A02
      • Samsung A01
    • Samsung note model
      • Samsung Note 20 ultra
      • Samsung Note 20
      • Samsung Note 10 plus
      • Samsung Note 10 Lite
      • Samsung Note 10
      • Samsung Note 9
      • Samsung Note 8
      • Samsung Note 5
      • Samsung Note 4
    • Samsung X cover model
      • Samsung X cover 7
      • Samsung x cover 6 pro
      • Samsung x cover pro
      • Samsung x cover 5
      • Samsung x cover 4s
      • Samsung x cover 4
      • Samsung x cover 3
    • Samsung Z Fold , Z flip models
      • Samsung Z flip 7
      • Samsung Z flip 6
      • Samsung Z flip 5
      • Samsung Z Flip 4
      • Samsung Z Flip 3
      • Samsung Z fold 7
      • Samsung Z fold 7 FE
      • Samsung Z fold 6
      • Samsung Z fold 5
      • Samsung Z Fold 4
      • Samsung Z Fold 3
  • Samsung TAB models
  • Samsung TAB A series
  • Samsung TAB S Series
  • Samsung TAB E series
Browse Categories
  • Personal care, beauty and well-being
    • Hair dryer
    • Shaving and hair removal
Browse Categories
  • Huawei
    • Huawei P Models
      • Huawei P40 pro
      • Huawei P40 Lite
      • Huawei P40
      • Huawei P30 Pro
      • Huawei P30 Lite
      • Huawei P30
      • Huawei P20 Pro
      • Huawei P20 Lite 2019
      • Huawei P20 Lite
      • Huawei P20
      • Huawei P10 Lite
      • Huawei P10
      • Huawei P9 Lite
      • Huawei P9
      • Huawei P8 Lite
      • Huawei P8
      • Huawei P7
    • Huawei Mate Models
      • Huawei Mate 40 Pro
      • Huawei Mate 40
      • Huawei Mate 30 Pro
      • Huawei Mate 30 Lite
      • Huawei Mate 30
      • Huawei Mate 20 Pro
      • Huawei Mate 20 Lite
      • Huawei Mate 20
      • Huawei Mate 10 Pro
      • Huawei Mate 10 Lite
      • Huawei Mate 10
      • Huawei Mate 9 pro
      • Huawei Mate 9
      • Huawei Mate 8
      • Huawei Mate 7
    • Huawei P smart Models
      • Huawei P smart 2021
      • Huawei P smart 2020
      • Huawei P smart 2019
      • Huawei P smart pro
      • Huawei P smart Z
    • Huawei Honor Models
      • Huawei Honor 20 Pro
      • Huawei Honor 20 Lite
      • Huawei Honor View 20
      • Huawei Honor 20
      • Huawei Honor View 10
      • Huawei Honor 10
      • Huawei Honor 9
      • Huawei Honor 8 Lite
      • Huawei Honor 8
      • Huawei Honor 7
      • Huawei Honor 6
Browse Categories
  • Electronics
    • Headset , audio jack
    • Adapters
    • Cables
    • Car adapter , cables
    • Wirless charger
    • Bluetooth Speaker
    • HDMI , converter
    • Oudio Other
    • Gaming
    • Internet cables
    • Power bank
Browse Categories
  • Tempered Glass
    • OG tempered Glass
      • Iphone
      • Samsung
    • UV tempered Glass
      • Samsung
      • Huawei
    • Iphone camera Lens
    • Samsung camera lens
    • Ipad 3D
    • Samsung TAB
    • Apple Watch
    • Samsung watch
Browse Categories
  • Childeren toys
    • Car , Motor
Reparation
  • Home
  • Electronics
  • Mobile, tablet , smart watches
  • Repare Phone Price
  • Accessories
  • Tempered Glass
Click to enlarge
HomebrandsHoco UA27 HD on-screen cable Type-C to HDTV
Previous product
UPA13 iPhone digital audio conversion cable 199.00 kr
Back to products
Next product
UA15 HDMI cable adapter for Iphone 499.00 kr
Hoco

UA27 HD on-screen cable Type-C to HDTV

499.00 kr

1. Material: aluminum alloy + braid

2. Cable length: 2m; Weight: 40g

3. Interface: Type-C to HDMI

4. Resolution: Support 4K 30HZ

Brand

Hoco

Color

Grey

8 in stock

Compare
Add to wishlist
SKU: A183A Categories: Electronics, HDMI , converter, Hoco Tags: electronics, HDMI
  • Description
  • Reviews (0)
  • About brand
  • Shipping & Delivery
Description

1. Material: aluminum alloy + braid

2. Cable length: 2m; Weight: 40g

3. Interface: Type-C to HDMI

4. Resolution: Support 4K 30HZ

Reviews (0)

Reviews

There are no reviews yet.

Be the first to review “UA27 HD on-screen cable Type-C to HDTV” Cancel reply

Your email address will not be published. Required fields are marked *

About brand
HOCO TECHNOLOGY has established the brand “hoco.” since its initial establishment in 2009. Through many years development, the brand “hoco.” has developed into a globally famous brand of digital and mobile phone spare parts.
Shipping & Delivery

MAECENAS IACULIS

Vestibulum curae torquent diam diam commodo parturient penatibus nunc dui adipiscing convallis bulum parturient suspendisse parturient a.Parturient in parturient scelerisque nibh lectus quam a natoque adipiscing a vestibulum hendrerit et pharetra fames nunc natoque dui.

ADIPISCING CONVALLIS BULUM

  • Vestibulum penatibus nunc dui adipiscing convallis bulum parturient suspendisse.
  • Abitur parturient praesent lectus quam a natoque adipiscing a vestibulum hendre.
  • Diam parturient dictumst parturient scelerisque nibh lectus.

Scelerisque adipiscing bibendum sem vestibulum et in a a a purus lectus faucibus lobortis tincidunt purus lectus nisl class eros.Condimentum a et ullamcorper dictumst mus et tristique elementum nam inceptos hac parturient scelerisque vestibulum amet elit ut volutpat.

Related products

Compare
Quick view
Add to wishlist
Close

IDeal Wireless QI Charger

Rated 0 out of 5
13 left in stock
399.00 kr
Add to cart
Compare
Quick view
Add to wishlist
Close

Samsung 3M USB-C cable

Rated 0 out of 5
19 left in stock
249.00 kr
Add to cart
Compare
Quick view
Add to wishlist
Close

EW29 True wireless headset

Rated 0 out of 5
6 left in stock
899.00 kr
Add to cart
Samsung M USB cable
Compare
Quick view
Add to wishlist
Close

Samsung 3M USB cable

Rated 0 out of 5
17 left in stock
249.00 kr
Add to cart
Compare
Quick view
Add to wishlist
Close

EW43 True wireless headset

Rated 0 out of 5
3 left in stock
1,099.00 kr
Add to cart
Compare
Quick view
Add to wishlist
Close

Samsung music Headset AKG

Rated 0 out of 5
4 left in stock
349.00 kr
Add to cart
Compare
Quick view
Add to wishlist
Close

IDeal Wireless QI Charger

Rated 0 out of 5
16 left in stock
399.00 kr
Add to cart
Compare
Quick view
Add to wishlist
Close

X71 charging cable for IPhone 1M

Rated 0 out of 5
24 left in stock
149.00 kr
Add to cart
Samsung
OG
Luxury clear magnetic
IDEAL OF SWEDEN
Hoco
Gorilla Anti-Shock
Fashion
Celly Hello world
BOROFONE
Apple
AMA Extra pas
AMA
Adidas

Vi startet reisen vår i 2017, da etterspørselen etter reparasjoner og reservedeler til mobiltelefoner og nettbrett økte betraktelig. Alibaba Telecom AS åpnet sin første butikk på AMFI sentrum i Larvik og videre åpnet nye avdelinger i forskjellige byer. Alibaba Telecom AS ble en av de største leverandøren i Norden, med et stort lager på mer enn 100 000 høykvalitetsprodukter. .

Storgata 107, 3921 Porsgrunn, Norway
Phone: (0047) 48473337
Phone: (0047) 41201616
Recent Posts
  • Protected: drammen
    December 12, 2022 No Comments
  • Protected: stathelle
    December 12, 2022 No Comments
Useful links
  • ALIBABA TELECOM
  • Electronics
  • Accessories
  • Contact Us
  • Abuot US
Footer Menu
  • Home
  • reparation
  • faq
  • Contact Us
  • abute us
  • Shop
Hinet.co 2022 All rights of this website belong to alibabatelecom
payments
  • Home
  • Electronics
  • Mobile, tablet , smart watches
  • Repare Phone Price
  • Accessories
  • Tempered Glass
Shopping cart
close
Select your currency
NOK Norwegian krone
USD United States (US) dollar
EUR Euro

Sign in

close

Lost your password?

No account yet?

Create an Account