{"action":"closed","issue":{"url":"https://api.github.com/repos/tommcfarlin/WordPress-Plugin-Boilerplate/issues/261","labels_url":"https://api.github.com/repos/tommcfarlin/WordPress-Plugin-Boilerplate/issues/261/labels{/name}","comments_url":"https://api.github.com/repos/tommcfarlin/WordPress-Plugin-Boilerplate/issues/261/comments","events_url":"https://api.github.com/repos/tommcfarlin/WordPress-Plugin-Boilerplate/issues/261/events","html_url":"https://github.com/tommcfarlin/WordPress-Plugin-Boilerplate/issues/261","id":56478464,"number":261,"title":"Can't create Custom Post Type when activate","user":{"login":"mrkyt","id":1009944,"avatar_url":"https://avatars.githubusercontent.com/u/1009944?v=3","gravatar_id":"","url":"https://api.github.com/users/mrkyt","html_url":"https://github.com/mrkyt","followers_url":"https://api.github.com/users/mrkyt/followers","following_url":"https://api.github.com/users/mrkyt/following{/other_user}","gists_url":"https://api.github.com/users/mrkyt/gists{/gist_id}","starred_url":"https://api.github.com/users/mrkyt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrkyt/subscriptions","organizations_url":"https://api.github.com/users/mrkyt/orgs","repos_url":"https://api.github.com/users/mrkyt/repos","events_url":"https://api.github.com/users/mrkyt/events{/privacy}","received_events_url":"https://api.github.com/users/mrkyt/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-02-04T04:21:38Z","updated_at":"2015-02-04T16:11:21Z","closed_at":"2015-02-04T16:11:21Z","body":"I try add to class Activator:\r\n<pre>\r\npublic static function activate() {\r\n        add_action( 'init', array( get_called_class(), 'create_custom_post_type' ),1 );\r\n        do_action( 'init' );\r\n}\r\npublic static function create_custom_post_type()\r\n{\r\n        // Create AFS post type\r\n        $labels = array(\r\n            'name' => __( 'Field&nbsp;Groups', 'afs' ),\r\n            'singular_name' => __( 'Advanced Frontend Submit Fields', 'afs' ),\r\n            'add_new' => __( 'Add New' , 'afs' ),\r\n            'add_new_item' => __( 'Add New Field Group' , 'afs' ),\r\n            'edit_item' =>  __( 'Edit Field Group' , 'afs' ),\r\n            'new_item' => __( 'New Field Group' , 'afs' ),\r\n            'view_item' => __('View Field Group', 'afs'),\r\n            'search_items' => __('Search Field Groups', 'afs'),\r\n            'not_found' =>  __('No Field Groups found', 'afs'),\r\n            'not_found_in_trash' => __('No Field Groups found in Trash', 'afs'),\r\n        );\r\n\r\n        register_post_type('afs', array(\r\n            'labels' => $labels,\r\n            'public' => false,\r\n            'show_ui' => true,\r\n            '_builtin' =>  false,\r\n            'capability_type' => 'page',\r\n            'hierarchical' => true,\r\n            'rewrite' => false,\r\n            'query_var' => \"afs\",\r\n            'supports' => array(\r\n                'title',\r\n            ),\r\n            'show_in_menu'  => false,\r\n        ));\r\n}\r\n</pre>\r\nAnd it not working! Please help me\r\n\r\n"}}