michaeluno / admin-page-framework

Facilitates WordPress plugin and theme development.
http://admin-page-framework.michaeluno.jp/
Other
340 stars 71 forks source link

Make it possible to define a post type in the setUp() method of post type factory class #174

Closed michaeluno closed 9 years ago

michaeluno commented 9 years ago

Currently the start() method needs to be used to pass the post type arguments or it must be done in the constructor. While I was writing a tutorial on how to create a custom post type with the framework, I found this is not intuitive and it should be able to do in the setUp() method.

For that, the timing of the hook that triggers setUp() method will be changed from wp_loaded to init. Also the setUp() method currently is only loaded in the admin area ( with the check of is_admin() ) but this will be not checked.

This is a minor change but may affect some users using the post type factory class.

michaeluno commented 9 years ago

Ready to be tested: Download.