Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 107

Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 234

Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 235

Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 236

Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 237

Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 238

Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 239
* @link https://themeum.com * @since 1.7.1 */ namespace TUTOR; use WP_REST_Request; if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Class REST_Author * * @package Tutor * @since 1.0.0 */ class REST_Author { use REST_Response; /** * User ID. * * @var int $user_id The ID of the user. */ private $user_id; /** * Retrieve author details via REST API. * * @param WP_REST_Request $request The REST request object. * * @return mixed */ public function author_detail( WP_REST_Request $request ) { $this->user_id = $request->get_param( 'id' ); $user_data = get_userdata( $this->user_id ); // Author object. $author = is_a( $user_data, 'WP_User' ) ? $user_data->data : false; if ( $author ) { // Unset user pass & key. unset( $author->user_pass ); unset( $author->user_activation_key ); // Get author course ID. $author->courses = get_user_meta( $this->user_id, '_tutor_instructor_course_id', false ); $response = array( 'code' => 'success', 'message' => __( 'Author details retrieved successfully', 'tutor' ), 'data' => $author, ); return self::send( $response ); } $response = array( 'code' => 'invalid_id', 'message' => __( 'Author not found', 'tutor' ), 'data' => array(), ); return self::send( $response ); } }