assets
1 year ago
loader.php
1 year ago
ppf-admin.php
1 year ago
ppf-class.php
1 year ago
ppf-plugin-addon.php
1 year ago
ppf-plugin.php
1 year ago
ppf-settings.php
1 year ago
ppf-subclass.php
1 year ago
ppf-subclass.php
101 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Plugin Base Sub-Class |
| 5 | * |
| 6 | * Peter's Plugins Foundation 09 |
| 7 | * |
| 8 | * @package PPF09 |
| 9 | * @author Peter Raschendorfer |
| 10 | * @license GPL2+ |
| 11 | */ |
| 12 | |
| 13 | if ( ! defined( 'ABSPATH' ) ) { |
| 14 | exit; // Exit if accessed directly |
| 15 | } |
| 16 | |
| 17 | if ( !class_exists( 'PPF09_SubClass' ) ) { |
| 18 | |
| 19 | |
| 20 | abstract class PPF09_SubClass extends PPF09_Class { |
| 21 | |
| 22 | /** |
| 23 | * reference to core class |
| 24 | * |
| 25 | * @since PPF01 |
| 26 | * @var object |
| 27 | * @access protected |
| 28 | * was private prior to PPF04 |
| 29 | */ |
| 30 | protected $_core; |
| 31 | |
| 32 | |
| 33 | /** |
| 34 | * reference to settings class |
| 35 | * |
| 36 | * @since PPF01 |
| 37 | * @var object |
| 38 | * @access protected |
| 39 | * was private prior to PPF04 |
| 40 | */ |
| 41 | protected $_settings; |
| 42 | |
| 43 | |
| 44 | /** |
| 45 | * Init the Class |
| 46 | * |
| 47 | * @since PPF01 |
| 48 | * @access public |
| 49 | */ |
| 50 | public function __construct( $_core, $_settings = false ) { |
| 51 | |
| 52 | parent::__construct(); |
| 53 | |
| 54 | $this->_core = $_core; |
| 55 | $this->_settings = $_settings; |
| 56 | |
| 57 | $this->init(); |
| 58 | |
| 59 | } |
| 60 | |
| 61 | |
| 62 | /** |
| 63 | * Sub-Class init |
| 64 | * |
| 65 | * force to be defined |
| 66 | * |
| 67 | * @since PPF01 |
| 68 | */ |
| 69 | abstract public function init(); |
| 70 | |
| 71 | |
| 72 | /** |
| 73 | * get core class |
| 74 | * |
| 75 | * @since PPF01 |
| 76 | * @access public |
| 77 | * @return object |
| 78 | */ |
| 79 | public function core() { |
| 80 | |
| 81 | return $this->_core; |
| 82 | |
| 83 | } |
| 84 | |
| 85 | |
| 86 | /** |
| 87 | * get settings class |
| 88 | * |
| 89 | * @since PPF01 |
| 90 | * @access public |
| 91 | * @return object |
| 92 | */ |
| 93 | public function settings() { |
| 94 | |
| 95 | return $this->_settings; |
| 96 | |
| 97 | } |
| 98 | |
| 99 | } |
| 100 | |
| 101 | } |