Module.php
46 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Abstract Module. |
| 4 | * |
| 5 | * @package Custom_Post_Type_Permalinks |
| 6 | */ |
| 7 | |
| 8 | /** |
| 9 | * Class CPTP_Module |
| 10 | */ |
| 11 | abstract class CPTP_Module { |
| 12 | |
| 13 | /** |
| 14 | * Entry point. |
| 15 | */ |
| 16 | final public function init() { |
| 17 | $this->register(); |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * Register hook on CPTP_init. |
| 22 | */ |
| 23 | public function register() { |
| 24 | add_action( 'CPTP_init', array( $this, 'add_hook' ) ); |
| 25 | } |
| 26 | |
| 27 | /** |
| 28 | * Module hook point. |
| 29 | */ |
| 30 | abstract function add_hook(); |
| 31 | |
| 32 | /** |
| 33 | * Uninstall hooks |
| 34 | * |
| 35 | * @static |
| 36 | */ |
| 37 | public static function uninstall_hook() { |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * Fire on activate |
| 42 | */ |
| 43 | public function activation_hook() { |
| 44 | } |
| 45 | } |
| 46 |