{"action":"opened","issue":{"url":"https://api.github.com/repos/miya0001/tinymce-templates/issues/10","labels_url":"https://api.github.com/repos/miya0001/tinymce-templates/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/miya0001/tinymce-templates/issues/10/comments","events_url":"https://api.github.com/repos/miya0001/tinymce-templates/issues/10/events","html_url":"https://github.com/miya0001/tinymce-templates/issues/10","id":60862206,"number":10,"title":"Filter to manipulate register_post_type arguments","user":{"login":"timothy-h","id":5342087,"avatar_url":"https://avatars.githubusercontent.com/u/5342087?v=3","gravatar_id":"","url":"https://api.github.com/users/timothy-h","html_url":"https://github.com/timothy-h","followers_url":"https://api.github.com/users/timothy-h/followers","following_url":"https://api.github.com/users/timothy-h/following{/other_user}","gists_url":"https://api.github.com/users/timothy-h/gists{/gist_id}","starred_url":"https://api.github.com/users/timothy-h/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timothy-h/subscriptions","organizations_url":"https://api.github.com/users/timothy-h/orgs","repos_url":"https://api.github.com/users/timothy-h/repos","events_url":"https://api.github.com/users/timothy-h/events{/privacy}","received_events_url":"https://api.github.com/users/timothy-h/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-12T17:42:15Z","updated_at":"2015-03-12T17:42:15Z","closed_at":null,"body":"The current menu_position is hard-coded to 100. I have many sidebar items and I'd like to change this to a more appropriate position, like 64 (after Appearance but before Plugins). I also have several tiers of users and would like to change the capabilities. I managed to do this by:\r\n\r\n1. Changing TinyMCE_Templates::register_post_type to public\r\n2. Changing the direct call to register_post_type on line 119 to a filter:\r\n`add_filter( 'init', array( $this, 'register_post_type' ), 20 );`\r\n3. Removing the `capability_type` parameter from the arguments and adding `'capabilities' => apply_filters( 'tinymce_templates_capabilities', array() ),`\r\n4. Change the value of `menu_position` to:\r\n`apply_filters( 'tinymce_templates_menu_position', 64 )`\r\n\r\nOnce these changes have been made, it's trivial to add filters to a theme or plugin to alter the menu position and capabilities."}}