Wordpress Plugin Development tutorial from scratch (Part 19) By wp_ajax_{action} Post Data to Server
In this video session i have explained about, Post form data to Server by wp_ajax_{action} in wordpress. This is second method by which we can post form data to server. #WordpressTutorialsPoint #WordpressLearnersHub #WordpressCustomizations #LearnWordpressStepbyStep #WordpressBySanjay For method #1 for Ajax Request please click here to watch https://www.youtube.com/watch?v=n_3nXW8VzgQ Also watch how can we post form data to server by method #1 https://www.youtube.com/watch?v=1lS_8yBfnD4 And this which we are discussing here is wp_ajax_{action_name}: ====================== This hook allows you to create custom handlers for your own custom AJAX requests. The wp_ajax_ hook follows the format "wp_ajax_$youraction", where $youraction is your AJAX request's 'action' property. Client Request via javascript: =============== jQuery("#frmPostOtherPage").validate({ submitHandler:function(){ var post_data = jQuery("#frmPostOtherPage").serialize()+"&action=custom_ajax_req"; jQuery.post(ajaxurl,post_data,function( response){ var data = jQuery.parseJSON(response); console.log("Name: "+data.txtName+" and Email: "+data.txtEmail); }); } }); ("#frmPostOtherPage").serialize() Methods serializes all form data and send to server using action name and ajaxurl values of ajaxurl from admin_url("admin-ajax.php"); Now we have to handle from our plugin main file =============== add_action("wp_ajax_custom_ajax_req","custom_ajax_req_fn"); function custom_ajax_req_fn(){ echo json_encode($_REQUEST); // here we simply returned posted form data as response in encoded form wp_die(); } Documenation Study Notes: =============== https://codex.wordpress.org/Plugin_API/Action_Reference/wp_ajax_(action) Create database table dynamically by Wordpress Plugin, =============== Click here to watch: https://www.youtube.com/watch?v=nzRyFF95jXI 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 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 formatsNo download links available.