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';
}
Related Posts:
- Settings API – easiest way of validating checkboxes?
- Settings API not saving values to database
- Problem with Settings API: changes are not saved after submit
- [Multisite]How can I update custom blog option?
- How to pass variable to add_settings_section() callback?
- This CSS Stuffing Works, But Is This A Good Practice?
- Settings API – adding setting fields dynamically?
- WordPress Admin back-end – advanced options page?
- How should I use register_setting, add_settings_section, & add_settings_field in my plugin’s options page?
- How To View Site from Non-Logged-In User’s Perspective
- Custom plugin settings: clicking “save changes” does not display success message
- Is it safe to post form data via Ajax to the settings api? Am I missing something?
- wp_dropdown_pages() in theme admin page
- How can I show the contents of only a few users
- Admin option sidebar count
- Add Custom Script in Other Plugin’s Options page
- Accessing variable from admin panel?
- How can I POST or GET to the same admin page from which I am POST-ing or GET-ing
- WordPress custom admin functions security
- Show global Message in User Profiles with admin only Input field in WordPress Backend
- Settings API – Last two tabs not rendered separate
- Help to create the best plugin settings!
- Get Link of Page Selected through a Select Field in Custom Admin Page
- My code for creating an admin option doesn’t work
- I don’t have permission to save the theme options I created myself?
- Pull Random Images From Options Page [closed]
- Woo Commerce Settings for Check-out Form [closed]
- move setting data from wordpress api to codestar freamwork
- Hide other users’ posts in admin panel
- Editor Styles and Typekit
- WordPress admin stylesheet
- Can an admin check passwords of registered users?
- Plugin options will not save in database
- Prevent author from changing their posts if admin has modified
- Showing WP_Error message with admin_notice action hook
- register_setting() vs add_option()
- Taxonomy/category hierarchy lost when editing posts [closed]
- How to remove “Super Admin” from All Users for those that are not a “Super Admin”?
- Customize the upload screen
- How to print the output of the get_num_queries function from frontend to backend?
- Javascript not working in admin
- Setting Login with User Name and Password default option for Jetpack Admin Login
- How get Themes list via REST api?
- Adminstering Large Number of WordPress Sites
- Admin: global $post empty
- How to remove “publish metabox” from each post type
- How to add settings subpage from a plugin to a settings page created in theme?
- Admin doesn’t have sufficient permissions to plugin’s page
- How to restrict the editors from viewing/editing pages created by admin?
- How do I add a contact form?
- Unable to login, old site with previous developer gone
- How to default display name to first name and last and disable the profile field
- Adding html format on tinymce visual editor
- Two Types of settings in WP – The Doubt
- WordPress ACL (folder + permissions)
- How-to turn off mobile admin mode?
- Move Custom Fields on General Settings Page to New Location
- How can I make the user names of commentors clickable links to the user’s profile from the admin comment screen?
- Grabbing the first image attached to a post and use it with the admin columns
- Keep Logged in Users out of Admin Panel
- Is there a wp-config.php option or constant that I can set to allow me to download nightly / beta builds?
- How to save custom settings api fields with custom section fuction
- Output the admin menu_position for each item
- Admin login not working
- Live reload preview just reloads forever
- Hide admin notice when user profile updated
- WordPress Screen options does not show any fields
- current_user_can(‘administrator’) not working in custom login
- WordPress modify Settings > Permalinks (options-permalink.php) Add CPT Permalink Options
- WP Page Options Array
- Black admin bar is being hidden by page elements
- admin edit link from a specific page
- Set Link Target Checkbox chcked on Edit Image MOdal Window in Admin Post Edit Screen?
- How do I display a WP Option from an array?
- Username was changed to “admin”
- Top toolbar is not showing in wordpress admin panel
- Authorize subdomain to access and read user and admin cookies
- Can’t see past events on admin dashboard
- Multisite Equivalent of `register_setting`?
- Unable to access admin web page
- Error “Sorry, you are not allowed to access this page”
- Create WordPress Menu Item Without Linking to a Custom Page
- Search Only Works when Logged into Admin
- exclude ID on avatar
- Missing content on website. Admins cant sign in
- Is Post-Form Resubmission somehow prevented in WordPress 4.2.2?
- WordPress login not working
- Dynamically Update Key in Associative Array When Saving Settings
- Enqueue script throws error in console
- How to sort post_meta in edit.php?
- Scripts are not called until I login from wordpress backend
- Link to all posts page?
- WP Logs me out after updating anything on dashboard
- Calculate and save an average in a meta
- If the only thing I use MySQL for is WordPress, do I need MySQL’s timezone tables?
- plugin to upload to youtube via wordpress [closed]
- My Account Lost Administrator permission
- WordPress admin panel is blank
- deploying a standard build of wordpress in WHM/cPanel
- Where to adjust presets for slider options “auto rotate” (3, 5, 10, 15 seconds)? [closed]