| 1 | <?php |
||
| 39 | class AdminPageFramework_PointerToolBox extends AdminPageFramework_WPUtility { |
||
|
2 ignored issues
–
show
|
|||
| 40 | |||
| 41 | static private $_bResourceLoaded = false; |
||
|
1 ignored issue
–
show
|
|||
| 42 | |||
| 43 | public $sPointerID; |
||
| 44 | |||
| 45 | public $aPointerData; |
||
| 46 | |||
| 47 | /** |
||
| 48 | * User set screen IDs. Accepts APF page slugs. |
||
| 49 | */ |
||
| 50 | public $aScreenIDs = array(); |
||
| 51 | |||
| 52 | |||
| 53 | /** |
||
| 54 | * Sets up hooks and properties. |
||
| 55 | * |
||
| 56 | * @since DEVVER |
||
| 57 | * @see https://codex.wordpress.org/Plugin_API/Admin_Screen_Reference |
||
| 58 | * @param array|strin $asScreenIDs Screen IDs or page slug. |
||
| 59 | * @param string $sPointerID A unique pointer ID. |
||
| 60 | * @Param array $aPointerData The pointer data. |
||
| 61 | */ |
||
| 62 | public function __construct( $asScreenIDs, $sPointerID, array $aPointerData ) { |
||
| 92 | /** |
||
| 93 | * |
||
| 94 | */ |
||
| 95 | private function _setHooks( $aScreenIDs ) { |
||
| 107 | /** |
||
| 108 | * @return boolean |
||
| 109 | */ |
||
| 110 | private function _shouldProceed() { |
||
| 117 | |||
| 118 | /** |
||
| 119 | * @callback filter {class name}-{screen id} |
||
| 120 | * @return array |
||
| 121 | */ |
||
| 122 | public function _replyToSetPointer( $aPointers ) { |
||
| 127 | |||
| 128 | /** |
||
| 129 | * @callback action admin_enqueue_scripts |
||
| 130 | */ |
||
| 131 | public function _replyToLoadPointer( /* $hook_suffix */ ) { |
||
| 144 | /** |
||
| 145 | * Get pointers for this screen |
||
| 146 | * @return array |
||
| 147 | */ |
||
| 148 | private function _getPointers() { |
||
| 162 | |||
| 163 | /** |
||
| 164 | * @return array |
||
| 165 | * @since DEVVER |
||
| 166 | */ |
||
| 167 | private function _getValidPointers( $_aPointers ) { |
||
| 205 | /** |
||
| 206 | * @return boolean |
||
| 207 | * @since DEVVER |
||
| 208 | */ |
||
| 209 | private function _shouldSkip( $_iPointerID, $_aDismissed, $_aPointer ) { |
||
| 229 | |||
| 230 | private function _loadScripts( $_aValidPointers ) { |
||
| 262 | |||
| 263 | /** |
||
| 264 | * Renders the script. |
||
| 265 | */ |
||
| 266 | public function _renderScript() { |
||
| 269 | /** |
||
| 270 | * Returns an inline JavaScript script. |
||
| 271 | * |
||
| 272 | * @since DEVVER |
||
| 273 | * @return string |
||
| 274 | */ |
||
| 275 | public function _getScript() { |
||
| 303 | |||
| 304 | } |
||
|
1 ignored issue
–
show
|
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.