LLMS_Metabox_Field::get_post_meta( int $post_id, string $field_id )

Set the default meta value of a field.


Parameters Parameters

$post_id

(int) (Required) WP Post ID.

$field_id

(string) (Required) ID/name of the field.


Top ↑

Return Return

(mixed)


Top ↑

Source Source

File: includes/admin/post-types/meta-boxes/fields/llms.class.meta.box.fields.php

	public static function get_post_meta( $post_id, $field_id ) {

		if ( '_post_course_difficulty' === $field_id ) {
			$difficulties = wp_get_object_terms( $post_id, 'course_difficulty' );

			if ( $difficulties ) {
				return $difficulties[0]->slug;
			}
		} else {
			return get_post_meta( $post_id, $field_id, true );
		}

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.24.0 Unknown.
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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