You can add above code on plugin activation hook so that code run whenever you activate plugin.
For checkbox You need to define table column type as Boolean.
Dont forget to check table is already exist or not. otherwise it show error on second activation.
Related Posts:
- Custom Permalink Plugin and Current Page/Ancestor in Menus
- How can i change the texts of plugin (created by me) in wordpress admin?
- How can integrate zend module with wordpress admin dashbord [closed]
- How do I add image to the title of post?
- Can a plugin be run in a different language than WordPress?
- Woocommerce showing images blurry in description page
- “Conflict” with jQuery (or its plugins)?
- Overwrite category head title
- Executing jQuery in a plugin
- modify plugin to support RTL
- Can I use register_settings and unregister_setting once the settings page has loaded?
- Bulk update wordpress posts
- Plugin function inside custom plugin
- Adding media upload button to User Profile page (following a tutorial)
- Placing the two most voted posts at the top (in a WordPress site that uses the Vote it up plugin)?
- “W3 Total Cache” with “What Would Seth Godin Do” (and widgets?!)? [closed]
- posts from multiple post types in one slider
- How to have a gallery in which each image’s caption is a whole “post”?
- WordPress Stock Update Programatically
- I Setup Rate My Post Plugin On Site But Now Got Issues In Google Webmasters
- Custom API plugin to execute 3rd party API to retrieve data
- plugin generated unexpected output during activation, but it is empty
- How to link a form to a product [closed]
- Enable Shortcode for Custom Wordress Widgets
- Remember the Meta Value With Radio Buttons
- How can I apply no-disposable when programmatically adding a user with wp_insert_user()?
- Translation to ACF relationship field
- Plugin code will not work properly inside a class [closed]
- how to check if a shortcode is used more than one time in the same post
- Theme Functions run a function upon activation or preview
- Custom Module, Extending WP with a Plugin?
- Warning! PHP safe mode enabled!
- Dictionary-style definition list plugin
- acceptance_as_validation: on is not working Contact form 7 [closed]
- “User need to be logged in in order to make a booking” issue
- Custom Plugin scripts from admin working in frontend
- Error Metabox Warning: call_user_func() expects parameter 1 to be a valid callback
- How to properly use wp_mail() in my own plugin?
- Cannot pass value variable to WP AJAX functions
- How to properly enqueue jQuery knob on WordPress without conflict?
- Add custom WordPress admin page with pretty url via code
- add_action(‘the_content’, ‘my_plugin_content’) is null
- WordPress logout appends cache/all/index.php to the site_url()
- WP Posts-pages text hiding does not work
- Update content without the user having to refresh their page
- how to add navigation icons in specific template?
- Description is not showing in plugin page
- Using any plugin results in http 500 error (and only plugins)
- Not able to upload Plugins/ Theme from Admin backend
- How to override the plugin in woocommerce
- Update javascript URL in header – Domain Mapping Plugin [closed]
- I am trying to rewrite urls in WordPress, but its not working
- How to see in Edit Comments if comment is from User and her Roles
- Delete postmeta when uninstall/delete plugin
- How to remove a css class for any wordpress page
- Speed issues because of CSS & JavaScript
- how can i get records from wp_postmeta table using particular meta_key in database?
- Form is not getting submitted [closed]
- How to get the list of languages provided by a plugin
- Should I paste CDN links in a JS file or use a Bootstrap CDN plugin?
- Write mysql credentials in plugin
- Getting warning while deleting custom fields
- Posted posts scheduling to unhide for new members
- How to Order Sticky Posts? [duplicate]
- export high ress images to pdf
- Embedding code snippets in posts with indentation
- Editor have not permissions for a plugin
- Plugin that uses AngularJS tutorial
- custom url with custom post
- How to tell if a script is being executed from a plugin, a theme or a child theme in WordPress?
- SWF in wordpress post
- MySql Query for WordPress
- How do i use the use the wooCommerce functions in a wordpress plugin?
- show Visual form builder in the front end
- Fake Single WordPress Post (Page) Loop
- woocommerce download post-types\writepanels limits?
- WordPress repository forbids me call wp-load.php in non-WordPress file
- WordPress get id from json data with json_decode()
- Extend my plugin settings with hooks
- Manually updating a plugin , is it overriding the previous settings of the plugin?
- Make a plugin work on specified domain only
- how to change location of the plugins & wordpress themes folder
- how woocommerce swatch color name when hovered or selected
- Undefined constant error in pluggable.php
- WooCommerce plugins permalinks?
- Requires PHP version 5.3.0
- How to Move a production WordPress site to local environment [closed]
- Neither update_option nor delete_option fires in deactivation hook
- Custom wordpress plugin does not save select element
- Need help with wordpress audio preload
- Share or sync user table data with another user table
- move setting data from wordpress api to codestar freamwork
- How to access the page without registering in wordpress
- CPT template is not being automatically used single post pages
- How to create new title and its description inside a section in WP Customizer?
- Issue: Unable to Access WordPress Admin and Database Errors
- I want to move the one click accesbility button on bottom of my website screen,
- WordPress : how to create onglet and remove it when only one
- Which approach for managing automatic updates would be more robust?
- Custom Elementor controls not appearing in the widget Advanced tab using injection hooks