{"action":"created","issue":{"url":"https://api.github.com/repos/DevinVinson/WordPress-Plugin-Boilerplate/issues/398","repository_url":"https://api.github.com/repos/DevinVinson/WordPress-Plugin-Boilerplate","labels_url":"https://api.github.com/repos/DevinVinson/WordPress-Plugin-Boilerplate/issues/398/labels{/name}","comments_url":"https://api.github.com/repos/DevinVinson/WordPress-Plugin-Boilerplate/issues/398/comments","events_url":"https://api.github.com/repos/DevinVinson/WordPress-Plugin-Boilerplate/issues/398/events","html_url":"https://github.com/DevinVinson/WordPress-Plugin-Boilerplate/issues/398","id":176653722,"number":398,"title":"Best Practice when adding action","user":{"login":"yehiasalam","id":201734,"avatar_url":"https://avatars.githubusercontent.com/u/201734?v=3","gravatar_id":"","url":"https://api.github.com/users/yehiasalam","html_url":"https://github.com/yehiasalam","followers_url":"https://api.github.com/users/yehiasalam/followers","following_url":"https://api.github.com/users/yehiasalam/following{/other_user}","gists_url":"https://api.github.com/users/yehiasalam/gists{/gist_id}","starred_url":"https://api.github.com/users/yehiasalam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yehiasalam/subscriptions","organizations_url":"https://api.github.com/users/yehiasalam/orgs","repos_url":"https://api.github.com/users/yehiasalam/repos","events_url":"https://api.github.com/users/yehiasalam/events{/privacy}","received_events_url":"https://api.github.com/users/yehiasalam/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-13T14:21:32Z","updated_at":"2016-09-19T18:57:03Z","closed_at":null,"body":"Hi,\r\n\r\nThis boilerplate is great and giving me a head start , and I want to ask something regarding the best practices. I'm creating a separate class for each admin page. so I have for example `class-myplugin-admin-jobs.php` in my admin folder. \r\n\r\nNow from what i see in the `class-myplugin.php` we are adding all the actions using the `loader`, and I was wondering is it a best practice to add all the actions there, or in the construct function in my separate `admin `classes. The construct function makes more sense since the class will be responsible for injecting its own actions and classes."},"comment":{"url":"https://api.github.com/repos/DevinVinson/WordPress-Plugin-Boilerplate/issues/comments/248088066","html_url":"https://github.com/DevinVinson/WordPress-Plugin-Boilerplate/issues/398#issuecomment-248088066","issue_url":"https://api.github.com/repos/DevinVinson/WordPress-Plugin-Boilerplate/issues/398","id":248088066,"user":{"login":"143markr","id":21343635,"avatar_url":"https://avatars.githubusercontent.com/u/21343635?v=3","gravatar_id":"","url":"https://api.github.com/users/143markr","html_url":"https://github.com/143markr","followers_url":"https://api.github.com/users/143markr/followers","following_url":"https://api.github.com/users/143markr/following{/other_user}","gists_url":"https://api.github.com/users/143markr/gists{/gist_id}","starred_url":"https://api.github.com/users/143markr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/143markr/subscriptions","organizations_url":"https://api.github.com/users/143markr/orgs","repos_url":"https://api.github.com/users/143markr/repos","events_url":"https://api.github.com/users/143markr/events{/privacy}","received_events_url":"https://api.github.com/users/143markr/received_events","type":"User","site_admin":false},"created_at":"2016-09-19T18:57:03Z","updated_at":"2016-09-19T18:57:03Z","body":"Thanks for this boilerplate.\r\n\r\nI'm also having trouble with the loader class. I'm attempting to follow a tutorial on implementing the settings api in a plugin with OOP priniciples (https://tommcfarlin.com/defining-an-interface-for-the-wordpress-settings-api/) and they, and almost everyone else online it seems, want to load their hooks in the construct.\r\n\r\nI have no problem with the loader. But, would you please explain to an OOP noob how to alter existing classes that happen to load hooks in their constructs, so that they may instead be used with this loader class?"}}
{"actor":{"display_login":"143markr"}}