forked from DevinVinson/WordPress-Plugin-Boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 1
Functions visibility needed
Moisés Barrachina Planelles edited this page Oct 4, 2023
·
2 revisions
A quick summary for what visibility to use on the functions of your plugin:
Don't use private functions, BFT use inheritance on the classes and a private function can't inheritance
Ideal for the internal functions for security reasons, only your classes can use these functions
Some functions need to be public due to how WordPress works:
* Functions called via $this->admin_pages -> an_admin_page -> 'function_load' data
* Functions called via $this->admin_pages -> an_admin_page -> 'function' data
* Functions called via install, upgrade or uninstall
* Functions called via shortcodes
* Functions called via AJAX responses