Module.php
29 lines
| 1 | <?php |
| 2 | |
| 3 | abstract class CPTP_Module { |
| 4 | |
| 5 | final public function init() { |
| 6 | $this->register(); |
| 7 | } |
| 8 | |
| 9 | public function register() { |
| 10 | add_action( 'CPTP_init', array( $this, 'add_hook' ) ); |
| 11 | } |
| 12 | |
| 13 | abstract function add_hook(); |
| 14 | |
| 15 | /** |
| 16 | * uninstall hooks |
| 17 | * |
| 18 | * @static |
| 19 | */ |
| 20 | public static function uninstall_hook() { |
| 21 | } |
| 22 | |
| 23 | /** |
| 24 | * fire on activate |
| 25 | */ |
| 26 | public function activation_hook() { |
| 27 | } |
| 28 | } |
| 29 |