Skip to content

Commit b15fad9

Browse files
committed
Add CMB2::set_prop() method for setting CMB2 properties
1 parent f2a8406 commit b15fad9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

includes/CMB2.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,19 @@ public function set_prop( $property, $value ) {
928928
return $this->prop( $property );
929929
}
930930

931+
/**
932+
* Set metabox property.
933+
* @since 2.2.0
934+
* @param string $property Metabox config property to retrieve
935+
* @param mixed $value Value to set if no value found
936+
* @return mixed Metabox config property value or false
937+
*/
938+
public function set_prop( $property, $value ) {
939+
$this->meta_box[ $property ] = $value;
940+
941+
return $this->prop( $property );
942+
}
943+
931944
/**
932945
* Get metabox property and optionally set a fallback
933946
* @since 2.0.0

0 commit comments

Comments
 (0)