Back to Browse

Wordpress Plugin Development tutorial from scratch (Part 28) "My Book" Plugin Create/Drop Table #5

3.7K views
Feb 19, 2018
16:53

In this video session we will discuss about "My Book" Plugin tables script, 1. How can we create table when plugin activates? 2.How can we drop table when plugin deactivates or uninstalls? #WordpressTutorialsPoint #WordpressLearnersHub #WordpressCustomizations #LearnWordpressStepbyStep #WordpressBySanjay function my_book_table() { global $wpdb; return $wpdb-prefix . "my_books"; //wp_my_books } function my_book_generates_table_script() { global $wpdb; require_once ABSPATH . 'wp-admin/includes/upgrade.php'; $sql = " CREATE TABLE `" . my_book_table() . "` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `author` varchar(255) DEFAULT NULL, `about` text, `book_image` text, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1"; dbDelta($sql); } register_activation_hook(__FILE__, "my_book_generates_table_script"); function drop_table_plugin_books() { global $wpdb; $wpdb-query("DROP TABLE IF EXISTS " . my_book_table()); } register_deactivation_hook(__FILE__, "drop_table_plugin_books"); // register_uninstall_hook(__FILE__,"drop_table_plugin_books"); To add an administration menu =============== Please Watch for help: https://www.youtube.com/watch?v=vpksyjXRcyE&list=PLT9miexWCpPUQkQwL-COHmo0Jd0qxLjTn&index=3 To add an administration submenus: =============== Please Watch for help: https://www.youtube.com/watch?v=opOfxoViN0M Important Videos from Plugin Development Series =============== About Shortcodes in wordpress: https://www.youtube.com/watch?v=F9Woyst2fr8 Ajax Request in wordpress by wp_ajax_{action_name}: https://www.youtube.com/watch?v=RAwahYG8Qfc Insert data from form to wordpress database table: https://www.youtube.com/watch?v=UxBDUzQHeMY Create Wordpress page on Plugin Activation: https://www.youtube.com/watch?v=oL8ffxggYZY SOCIAL : =============== Subscribe : https://www.youtube.com/channel/UCB2flCo-gW6RhpVVXySqcMg FACEBOOK : https://www.facebook.com/onlinewebtutorhub/ TWITTER: https://twitter.com/owthub BLOG: https://onlinewebtutorhub.blogspot.in/ RECOMMENDATION: =============== 1. Some knowledge of PHP, HTML for this video series 2. How to Install Wordpress: https://www.youtube.com/watch?v=MREgql9jmf0 Also you can learn Wordpress Custom =============== Theme Development: https://www.youtube.com/watch?v=MREgql9jmf0&list=PLT9miexWCpPV9WxY_QG3qxUGKzw54LboW Widget Development: https://www.youtube.com/watch?v=ZSbdYG1svV8&list=PLT9miexWCpPUgibUXDZ7JP1j3U-m61U8m Theme Options Development: https://www.youtube.com/watch?v=Ixq5IARSlgg&list=PLT9miexWCpPVwbt89KoRE5qBgJAlHUuLf Tags =============== online web tutor, profotech solutions, wordpress plugin development from scratch in hindi, wordpress plugin development from scratch in easy steps, wordpress plugin development, wordpress plugin development in easy steps, plugin development in wordpress from scratch in hindi, plugin development in wordpress by online web tutor, plugin development in wordpress tutorials from scratch in hindi, plugin theme development tutorials in hindi, plugin development tutorials in hindi, owt tuts, online web tutorials, Thanks Online Web Tutor Keep learning and Sharing :) -~-~~-~~~-~~-~- Please watch: "Learn backbone.js tutorial from scratch" https://www.youtube.com/watch?v=HOAU-nfy5Sc -~-~~-~~~-~~-~-

Download

0 formats

No download links available.

Wordpress Plugin Development tutorial from scratch (Part 28) "My Book" Plugin Create/Drop Table #5 | NatokHD