{"action":"closed","issue":{"url":"https://api.github.com/repos/WebDevStudios/CMB2/issues/590","repository_url":"https://api.github.com/repos/WebDevStudios/CMB2","labels_url":"https://api.github.com/repos/WebDevStudios/CMB2/issues/590/labels{/name}","comments_url":"https://api.github.com/repos/WebDevStudios/CMB2/issues/590/comments","events_url":"https://api.github.com/repos/WebDevStudios/CMB2/issues/590/events","html_url":"https://github.com/WebDevStudios/CMB2/issues/590","id":133029388,"number":590,"title":"WP Editor and Textarea name attribute","user":{"login":"widoz","id":1917784,"avatar_url":"https://avatars.githubusercontent.com/u/1917784?v=3","gravatar_id":"","url":"https://api.github.com/users/widoz","html_url":"https://github.com/widoz","followers_url":"https://api.github.com/users/widoz/followers","following_url":"https://api.github.com/users/widoz/following{/other_user}","gists_url":"https://api.github.com/users/widoz/gists{/gist_id}","starred_url":"https://api.github.com/users/widoz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/widoz/subscriptions","organizations_url":"https://api.github.com/users/widoz/orgs","repos_url":"https://api.github.com/users/widoz/repos","events_url":"https://api.github.com/users/widoz/events{/privacy}","received_events_url":"https://api.github.com/users/widoz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-02-11T17:01:06Z","updated_at":"2016-04-03T11:08:56Z","closed_at":"2016-04-03T11:08:56Z","body":"Why don't allow to overwrite the option **textarea_name** for the wysiwyg editor?\r\n\r\nIn **cmb2/includes/CMB2_Field.php** at line **968** \r\n\r\n```php\r\nif ( 'wysiwyg' == $args['type'] ) {\r\n\t$args['id'] = strtolower( str_ireplace( '-', '_', $args['id'] ) );\r\n\t$args['options']['textarea_name'] = $args['_name'];\r\n}\r\n```\r\n\r\nIn that way you are unable to store the content as sub element of an array. \r\nFor example:\r\n\r\n```php\r\n$this->_cmb2->add_field( [\r\n\t'name' => 'Editor Name',\r\n\t'id' => 'content-id',\r\n\t'type' => 'wysiwyg',\r\n\t'options'   => [\r\n\t\t'wpautop' => true,\r\n\t\t'media_buttons' => false,\r\n\t\t'textarea_name' => $this->_key . '[my_content]',\r\n\t\t'teeny' => true,\r\n\t\t'quicktags' => false,\r\n\t\t'tinymce' => [\r\n\t\t\t'paste_remove_styles' => true,\r\n\t\t\t'paste_remove_spans' => true,\r\n\t\t\t'plugins' => 'wplink',\r\n\t\t\t'toolbar1' => 'bold,italic,link,unlink',\r\n\t\t],\r\n\t],\r\n] );\r\n```\r\nAlso that not break the coherency with other fields where I can set my custom **name** attribute?\r\n\r\nIn any case I change it in this way:\r\n\r\n```php\r\nif ( 'wysiwyg' == $args['type'] ) {\r\n\t$args['id'] = strtolower( str_ireplace( '-', '_', $args['id'] ) );\r\n\r\n        if ( empty( $args['options']['textarea_name'] ) ) {\r\n              $args['options']['textarea_name'] = $args['_name'];\r\n        }\r\n}\r\n```"}}