BP_REST_Learndash_Courses_Endpoint::get_feature_media( WP_Post $post )

Get Featured Media.

Description

Parameters

$post

(WP_Post) (Required) Object of wp_post.

Return

(array)

Source

File: bp-integrations/learndash/classes/class-bp-rest-learndash-courses-endpoint.php

	public function get_feature_media( $post ) {
		$return = array(
			'large'  => null,
			'medium' => null,
			'thumb'  => null,
		);

		if ( empty( get_post_thumbnail_id( $post->ID ) ) ) {
			return $return;
		}

		return array(
			'large'  => wp_get_attachment_image_url( get_post_thumbnail_id( $post->ID ), 'large' ),
			'medium' => wp_get_attachment_image_url( get_post_thumbnail_id( $post->ID ), 'medium' ),
			'thumb'  => wp_get_attachment_image_url( get_post_thumbnail_id( $post->ID ), 'thumbnail' ),
		);
	}

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.