HDTutorial
EN

Playback starts YouTube’s embedded player (privacy-enhanced mode).

Wordpress Plugin Development tutorial from scratch (Part 10) Wordpress Page on plugin activation

9,208 views November 12, 2018 17:44

Watch on YouTube
ChannelOnline Web Tutor

Description from the creator

In this video session i have explained about creating database table while plugin activation,

#WordpressTutorialsPoint
#WordpressLearnersHub
#WordpressCustomizations
#LearnWordpressStepbyStep
#WordpressBySanjay

Steps to do this task:
#1: Create Custom Post Code to Wordpress
#2: Embed generated code to function
#3: Bind with action hook

First we need Create Post code,
===============
// code for create page
$page = array();
$page['post_title']= "Custom Plugin Online Web Tutor";
$page['post_content']= "Learning Platform for Wordpress Customization for Themes, Plugin and Widgets";
$page['post_status'] = "publish";
$page['post_slug'] = "custom-plugin-online-web-tutor";
$page['post_type'] = "page";

$post_id = wp_insert_post($page); // post_id as return value

Documentation of 'wp_insert_post' : developer.wordpress.org/reference/functions/wp_…

Then we have to make a seperate function to run,
// create post function,
function create_page(){
// code for create page
$page = array();
$page['post_title']= "Custom Plugin Online Web Tutor";
$page['post_content']= "Learning Platform for Wordpress Customization for Themes, Plugin and Widgets";
$page['post_status'] = "publish";
$page['post_slug'] = "custom-plugin-online-web-tutor";
$page['post_type'] = "page";

$post_id = wp_insert_post($page); // post_id as return value

add_option("custom_plugin_page_id",$post_id); // wp_options table from the name of custom_plugin_page_id
}

and Finally we have to attach with Action hook,
register_activation_hook(__FILE__,"create_page");

To create table while plugin activates,
Click here to see: youtube.com/watch?v=nzRyFF95jXI

Delete table while plugin deactivates/Uninstalls,
Click here to see: youtube.com/watch?v=sa28dHu6YCA

SOCIAL :
===============
Subscribe : youtube.com/channel/UCB2flCo-gW6RhpVVXySqcMg
FACEBOOK : facebook.com/onlinewebtutorhub/
TWITTER: twitter.com/owthub
BLOG: onlinewebtutorhub.blogspot.in/

RECOMMENDATION:
===============
1. Some knowledge of PHP, HTML for this video series
2. How to Install Wordpress: youtube.com/watch?v=MREgql9jmf0
3. register_deactivation_hook: developer.wordpress.org/reference/functions/reg…

Also you can learn Wordpress Custom
===============
Theme Development: youtube.com/watch?v=MREgql9jmf0&list=PLT9mi…
Widget Development: youtube.com/watch?v=ZSbdYG1svV8&list=PLT9mi…

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,

Thanks
Online Web Tutor
Keep learning and Sharing :)

-~-~~-~~~-~~-~-
Please watch: "Learn backbone.js tutorial from scratch"
youtube.com/watch?v=HOAU-nfy5Sc
-~-~~-~~~-~~-~-

About this tutorial

Online Web Tutor published this 17:44 video tutorial on November 12, 2018. It has been watched 9,208 times on YouTube.

Category
Education
Duration
17:44
Published
November 12, 2018
Views
9,208
Likes
81

Tags

Share

This tutorial in other languages