{"action":"created","issue":{"url":"https://api.github.com/repos/DevinVinson/WordPress-Plugin-Boilerplate/issues/325","labels_url":"https://api.github.com/repos/DevinVinson/WordPress-Plugin-Boilerplate/issues/325/labels{/name}","comments_url":"https://api.github.com/repos/DevinVinson/WordPress-Plugin-Boilerplate/issues/325/comments","events_url":"https://api.github.com/repos/DevinVinson/WordPress-Plugin-Boilerplate/issues/325/events","html_url":"https://github.com/DevinVinson/WordPress-Plugin-Boilerplate/issues/325","id":102614461,"number":325,"title":"Understanding plugin structure","user":{"login":"teastudio","id":6190492,"avatar_url":"https://avatars.githubusercontent.com/u/6190492?v=3","gravatar_id":"","url":"https://api.github.com/users/teastudio","html_url":"https://github.com/teastudio","followers_url":"https://api.github.com/users/teastudio/followers","following_url":"https://api.github.com/users/teastudio/following{/other_user}","gists_url":"https://api.github.com/users/teastudio/gists{/gist_id}","starred_url":"https://api.github.com/users/teastudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teastudio/subscriptions","organizations_url":"https://api.github.com/users/teastudio/orgs","repos_url":"https://api.github.com/users/teastudio/repos","events_url":"https://api.github.com/users/teastudio/events{/privacy}","received_events_url":"https://api.github.com/users/teastudio/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-23T12:31:32Z","updated_at":"2015-08-26T13:24:45Z","closed_at":null,"body":"Hi, I am trying to understand the Plugin Boilerplate structure of folders and some classes and I have a few questions:\r\n1. in \"plugin-name/plugin-name.php\" file you run \"activation/deactivation\" functions by \"register_activation_hook\". Why not in \"__construct\" method from \"includes/class-plugin-name.php\"?\r\n2. why are you using always static methods in classes?\r\n3. where should I register post_type, in \"class-plugin-name-activator.php\" or by call \"init\" action added into \"define_admin_hooks\"  ?\r\n\r\nthanks for explaining this."},"comment":{"url":"https://api.github.com/repos/DevinVinson/WordPress-Plugin-Boilerplate/issues/comments/135017928","html_url":"https://github.com/DevinVinson/WordPress-Plugin-Boilerplate/issues/325#issuecomment-135017928","issue_url":"https://api.github.com/repos/DevinVinson/WordPress-Plugin-Boilerplate/issues/325","id":135017928,"user":{"login":"DevinVinson","id":2940124,"avatar_url":"https://avatars.githubusercontent.com/u/2940124?v=3","gravatar_id":"","url":"https://api.github.com/users/DevinVinson","html_url":"https://github.com/DevinVinson","followers_url":"https://api.github.com/users/DevinVinson/followers","following_url":"https://api.github.com/users/DevinVinson/following{/other_user}","gists_url":"https://api.github.com/users/DevinVinson/gists{/gist_id}","starred_url":"https://api.github.com/users/DevinVinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DevinVinson/subscriptions","organizations_url":"https://api.github.com/users/DevinVinson/orgs","repos_url":"https://api.github.com/users/DevinVinson/repos","events_url":"https://api.github.com/users/DevinVinson/events{/privacy}","received_events_url":"https://api.github.com/users/DevinVinson/received_events","type":"User","site_admin":false},"created_at":"2015-08-26T13:24:45Z","updated_at":"2015-08-26T13:24:45Z","body":"The boilerplate attempts to follow best practices and WordPress standards. So for \r\n1 and 2) https://developer.wordpress.org/plugins/the-basics/activation-deactivation-hooks/\r\n\r\n3) In the admin hooks could definitely work. There is a bit more flexibility in where you do things based on how your plugin will work so I'm not super opinionated on that personally."}}