LLMS_Awards_Query::get_object( int|WP_Post $post )

Retrieve the object for a given result.


Parameters Parameters

$post

(int|WP_Post) (Required) Post object or ID.


Top ↑

Return Return

(LLMS_User_Achievement|LLMS_User_Certificate|null) Returns the award object or null for unexpected post types.


Top ↑

Source Source

File: includes/class-llms-awards-query.php

	protected function get_object( $post ) {

		$post_type = get_post_type( $post );
		if ( 'llms_my_achievement' === $post_type ) {
			return new LLMS_User_Achievement( $post );
		} elseif ( 'llms_my_certificate' === $post_type ) {
			return llms_get_certificate( $post );
		}

		return null;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
6.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.