options – Call require_once form admin page with checkbox
I’m creating a custom WP plugin. Inside my main file I’ve includes the following line of code:
define( 'MY_MODULES_PATH', MY_PLUGIN_PATH . 'modules/' ); require_once MY_MODULES_PATH . 'module_1.php'; require_once MY_MODULES_PATH . 'module_2.php'; require_once MY_MODULES_PATH . 'module_3.php';
I’ve also created an custom admin page with a checkbox option and it’s working perfectly with the WordPress API. The settings are saved successfully in the database!
However I would like to enable/disable the require_once option within my custom admin page and currently I’m quite stuck…
I’ve tried searching for a solution, but I’m not getting any results. Would anybody direct my in the right direction preferable by a tutorial or the WP codex?
Thanks in advance!