Core title is no longer allways required (works as any other metadata)
This commit is contained in:
parent
016bba7cbc
commit
2e8cfd5dd8
|
@ -48,7 +48,10 @@ class Core_Description extends Field_Type {
|
|||
*
|
||||
* @param TainacanEntitiesItem_Metadata_Entity $item_metadata
|
||||
* @return bool Valid or not
|
||||
*/
|
||||
*
|
||||
* Quarantine - Core metadata should be validated as any other metadata
|
||||
* and item title is no longer mandatory
|
||||
|
||||
public function validate(\Tainacan\Entities\Item_Metadata_Entity $item_metadata) {
|
||||
|
||||
$item = $item_metadata->get_item();
|
||||
|
@ -61,6 +64,8 @@ class Core_Description extends Field_Type {
|
|||
return $item->validate_prop('description');
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
public function validate_options( Field $field ) {
|
||||
|
||||
|
|
|
@ -49,7 +49,10 @@ class Core_Title extends Field_Type {
|
|||
*
|
||||
* @param TainacanEntitiesItem_Metadata_Entity $item_metadata
|
||||
* @return bool Valid or not
|
||||
*/
|
||||
*
|
||||
* Quarantine - Core metadata should be validated as any other metadata
|
||||
* and item title is no longer mandatory
|
||||
|
||||
public function validate(\Tainacan\Entities\Item_Metadata_Entity $item_metadata) {
|
||||
|
||||
$item = $item_metadata->get_item();
|
||||
|
@ -62,6 +65,7 @@ class Core_Title extends Field_Type {
|
|||
return $item->validate_prop('title');
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
public function validate_options( Field $field ) {
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ class Items extends Repository {
|
|||
'type' => 'string',
|
||||
'description' => __( 'Title of the item', 'tainacan' ),
|
||||
'on_error' => __( 'The title should be a text value and not empty', 'tainacan' ),
|
||||
'validation' => v::stringType()->notEmpty(),
|
||||
//'validation' => v::stringType()->notEmpty(),
|
||||
],
|
||||
'status' => [
|
||||
'map' => 'post_status',
|
||||
|
|
Loading…
Reference in New Issue