LLMS_Abstract_Generator_Posts::set_metadata( LLMS_Post_Model $post, array $raw )

Set all metadata for a given post object


Description Description

This method will only set metadata for registered LLMS_Post_Model properties.


Top ↑

Parameters Parameters

$post

(LLMS_Post_Model) (Required) An LLMS post object.

$raw

(array) (Required) Array of raw data.


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/abstracts/llms-abstract-generator-posts.php

	protected function set_metadata( $post, $raw ) {

		// Set all metadata.
		foreach ( array_keys( $post->get_properties() ) as $key ) {
			if ( isset( $raw[ $key ] ) ) {
				$post->set( $key, $raw[ $key ] );
			}
		}

	}


Top ↑

Changelog Changelog

Changelog
Version Description
4.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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