LLMS_Post_Model::set( string|array $key_or_array, mixed $val = '', boolean $allow_same_meta_value = false )
Setter.
Parameters Parameters
- $key_or_array
-
(string|array) (Required) Key of the property or an associative array of key/val pairs.
- $val
-
(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: ''
- $allow_same_meta_value
-
(boolean) (Optional) Whether or not updating a meta with the same value as stored in the db is allowed.
Default value: false
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
.
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 ); }
Expand full source code Collapse full source code View on GitHub
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. |