Call require_once form admin page with checkbox

I achieved my goal by doing an option check like so, which conditionally loads the various functions in module_2.php, in my main plugin file: // If the checkbox is checked, load module_2.php. if ( get_option( ‘my_checkbox_option’ ) ) { require_once MY_MODULES_PATH . ‘module_2.php’; }

Settings API form – submit with AJAX

I just tested your code, I guess the ajaxurl in your javascript is wrong, it must be: <?php echo admin_url( ‘options.php’ ); ?> This is the code I have tested. class TestAjaxSettingsAPI { public function __construct() { add_action( ‘admin_menu’, array( $this, ‘agy_admin_menu’ ) ); add_action( ‘admin_init’, array( $this, ‘agy_register_settings’) ); } public function agy_admin_menu() { … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)