LLMS_Post_Model::set( string|array $key_or_array, mixed $val = '', boolean $allow_same_meta_value = false )


Parameters Parameters


(string|array) (Required) Key of the property or an associative array of key/val pairs.


(mixed) (Optional) Value to set the property with. This parameter will be ignored when the first parameter is an associative array of key/val pairs.

Default value: ''


(boolean) (Optional) Whether or not updating a meta with the same value as stored in the db is allowed.

Default value: false

Top ↑

Return Return

(boolean) true on success, false on error or if the submitted value is the same as what's in the database and $allow_same_meta_value is false.

Top ↑

Source Source

File: includes/abstracts/abstract.llms.post.model.php

	public function set( $key_or_array, $val = '', $allow_same_meta_value = false ) {

		$model_array = $key_or_array;

		if ( ! is_array( $key_or_array ) ) {
			$model_array = array(
				$key_or_array => $val,

		return $this->set_bulk( $model_array, false, $allow_same_meta_value );


Top ↑

Changelog Changelog

Version Description
6.5.0 Introduced $allow_same_meta_value param.
3.34.0 Turned to be only a wrapper for the set_bulk() method.
3.30.3 Use wp_slash() when setting properties.
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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