fix: create default value to user metadata

This commit is contained in:
vnmedeiros 2021-05-13 10:05:18 -03:00
parent dddcc26652
commit 54fad8702a
1 changed files with 1 additions and 1 deletions

View File

@ -403,7 +403,7 @@ class Item_Metadata extends Repository {
$metadatum = $item_metadata->get_metadatum();
if ( $metadatum->get_metadata_type() == 'Tainacan\Metadata_Types\User' ) {
$options = $metadatum->get_metadata_type_options();
if ( isset($options['default_author']) && $options['default_author'] = 'yes') {
if ( isset($options['default_author']) && $options['default_author'] == 'yes') {
$value = $metadatum->is_multiple() ? [strval(get_current_user_id())] : strval(get_current_user_id());
$item_metadata->set_value($value);
if ( $item_metadata->validate() ) {