add id on core fields

This commit is contained in:
Eduardo humberto 2018-02-26 10:00:27 -03:00
parent b0c9a4fdfb
commit e0c630475c
2 changed files with 4 additions and 1 deletions

View File

@ -25,6 +25,7 @@ class Core_Description extends Field_Type {
public function render( $itemMetadata ){
return '<tainacan-textarea
id="tainacan-textarea-' . $itemMetadata->get_item()->get_slug() . '"
field_id ="'.$itemMetadata->get_field()->get_id().'"
item_id="'.$itemMetadata->get_item()->get_id().'"
value=\''.json_encode( $itemMetadata->get_value() ).'\'

View File

@ -24,7 +24,9 @@ class Core_Title extends Field_Type {
*/
public function render( $itemMetadata ){
return '<tainacan-text field_id ="'.$itemMetadata->get_field()->get_id().'"
return '<tainacan-text
id="tainacan-text-' . $itemMetadata->get_item()->get_slug() . '"
field_id ="'.$itemMetadata->get_field()->get_id().'"
item_id="'.$itemMetadata->get_item()->get_id().'"
value=\''.json_encode( $itemMetadata->get_value() ).'\'
name="'.$itemMetadata->get_field()->get_name().'"></tainacan-text>';