{"action":"created","issue":{"url":"https://api.github.com/repos/qTranslate-Team/qtranslate-x/issues/69","labels_url":"https://api.github.com/repos/qTranslate-Team/qtranslate-x/issues/69/labels{/name}","comments_url":"https://api.github.com/repos/qTranslate-Team/qtranslate-x/issues/69/comments","events_url":"https://api.github.com/repos/qTranslate-Team/qtranslate-x/issues/69/events","html_url":"https://github.com/qTranslate-Team/qtranslate-x/pull/69","id":59992837,"number":69,"title":"Added method for removing a content hook","user":{"login":"funkjedi","id":9314,"avatar_url":"https://avatars.githubusercontent.com/u/9314?v=3","gravatar_id":"","url":"https://api.github.com/users/funkjedi","html_url":"https://github.com/funkjedi","followers_url":"https://api.github.com/users/funkjedi/followers","following_url":"https://api.github.com/users/funkjedi/following{/other_user}","gists_url":"https://api.github.com/users/funkjedi/gists{/gist_id}","starred_url":"https://api.github.com/users/funkjedi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/funkjedi/subscriptions","organizations_url":"https://api.github.com/users/funkjedi/orgs","repos_url":"https://api.github.com/users/funkjedi/repos","events_url":"https://api.github.com/users/funkjedi/events{/privacy}","received_events_url":"https://api.github.com/users/funkjedi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-05T18:21:20Z","updated_at":"2015-03-10T06:04:55Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/qTranslate-Team/qtranslate-x/pulls/69","html_url":"https://github.com/qTranslate-Team/qtranslate-x/pull/69","diff_url":"https://github.com/qTranslate-Team/qtranslate-x/pull/69.diff","patch_url":"https://github.com/qTranslate-Team/qtranslate-x/pull/69.patch"},"body":"Adding method that will remove a content hook and restore the field back to its initial state.\r\n\r\n```js\r\n// Remove content hooks from ACF Repeater and Flexible Fields clones\r\njQuery('.acf-clone .wp-editor-area.qtranxs-translatable').each(function() {\r\n\tqTranslateConfig.qtx.removeContentHook(this);\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/qTranslate-Team/qtranslate-x/issues/comments/78000636","html_url":"https://github.com/qTranslate-Team/qtranslate-x/pull/69#issuecomment-78000636","issue_url":"https://api.github.com/repos/qTranslate-Team/qtranslate-x/issues/69","id":78000636,"user":{"login":"funkjedi","id":9314,"avatar_url":"https://avatars.githubusercontent.com/u/9314?v=3","gravatar_id":"","url":"https://api.github.com/users/funkjedi","html_url":"https://github.com/funkjedi","followers_url":"https://api.github.com/users/funkjedi/followers","following_url":"https://api.github.com/users/funkjedi/following{/other_user}","gists_url":"https://api.github.com/users/funkjedi/gists{/gist_id}","starred_url":"https://api.github.com/users/funkjedi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/funkjedi/subscriptions","organizations_url":"https://api.github.com/users/funkjedi/orgs","repos_url":"https://api.github.com/users/funkjedi/repos","events_url":"https://api.github.com/users/funkjedi/events{/privacy}","received_events_url":"https://api.github.com/users/funkjedi/received_events","type":"User","site_admin":false},"created_at":"2015-03-10T06:04:55Z","updated_at":"2015-03-10T06:04:55Z","body":"There are two specific use cases both relating to adding and removing custom fields on the fly.\r\n\r\n**1)** ACF keeps a set of dummy fields which are cloned in JS when a user adds a new row of repeatable fields. The problem is that when on `post.php` or `post-new.php` all textareas with the `.wp-editor-area` class automatically have content hooks added to them. This means the hidden dummy fields now have content hooks. When these fields are cloned to make the new set of fields it copies the modifications made by the content hooks. Which prevents us from adding content hooks to the new fields.\r\n\r\n**2)** If the user removes a set of repeatable fields the content hooks need to be removed. Otherwise when the form is submitted the `mlContentField` fields will still contain the deleted fields. Resulting in the data not actually being deleted."}}