Wordpress Plugin Development tutorial from scratch (Part 12) Custom JavaScript on Wordpress page
In this video session i have explained about Custom JavaScript on Wordpress page, I have explained about two ways to register custom javascript as follows #WordpressTutorialsPoint #WordpressLearnersHub #WordpressCustomizations #LearnWordpressStepbyStep #WordpressBySanjay Steps to do this task: #1: by using wp_localize_script. #2: by calling action hook 'wp_head' First we understand by wp_localize_script, =============== Documentation: https://developer.wordpress.org/reference/functions/wp_localize_script/ we have coded to our custom plugin as, wp_localize_script("cpl_script","ajaxurl",admin_url("admin-ajax.php")); 'cpl_script' (string) (Required) Script handle the data will be attached to. 'ajaxurl' (string) (Required) Name for the JavaScript object. Passed directly, so it should be qualified JS variable 'admin_url("admin-ajax.php")' (array) (Required) The data itself. The data can be either a single or multi-dimensional array. Second by using Action hook 'wp_head' =============== add_action("wp_head","custom_js_plugin"); function custom_js_plugin(){ // custom js code here // } According to our use we need to use either of them. Documentation of Action Hook 'wp_head': https://developer.wordpress.org/reference/functions/wp_head/ 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 3. register_deactivation_hook: https://developer.wordpress.org/reference/functions/register_deactivation_hook/ 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.