fix: fix: validate when the metadata value is `0` and required
This commit is contained in:
parent
52acf6f8ad
commit
5bce09fde8
|
@ -470,7 +470,7 @@ class Item_Metadata_Entity extends Entity {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (empty($value)) {
|
||||
if (empty($value) && $value !== '0' && $value !== 0) {
|
||||
if ($this->is_required()) {
|
||||
$validation_statuses = ['publish', 'future', 'private'];
|
||||
if (in_array($item->get_status(), apply_filters( 'tainacan-status-require-validation', $validation_statuses) )) {
|
||||
|
|
|
@ -168,7 +168,7 @@ class Metadatum extends Entity {
|
|||
/**
|
||||
* Return the an object child of \Tainacan\metadatum_Types\Metadata_Type with options
|
||||
*
|
||||
* @return \Tainacan\Metadata_Types\Metadata_Type The metadatum type class with filled options
|
||||
* @return \Tainacan\Metadata_Types\Metadata_Type|Object The metadatum type class with filled options
|
||||
*/
|
||||
function get_metadata_type_object(){
|
||||
$class_name = $this->get_metadata_type();
|
||||
|
|
Loading…
Reference in New Issue