Core title is no longer allways required (works as any other metadata)

This commit is contained in:
Leo Germani 2018-06-01 22:21:16 -03:00
parent 016bba7cbc
commit 2e8cfd5dd8
3 changed files with 12 additions and 3 deletions

View File

@ -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 ) {

View File

@ -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 ) {

View File

@ -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',