Wordpress Plugin Development tutorial from scratch (Part 23) Use of default wp_editor in Wordpress
In this video session we have discussed about default editor provided by wordpress i.e wp_editor in wp. In most cases we always use textarea to input our long text, but now you should use wp_editor. #WordpressTutorialsPoint #WordpressLearnersHub #WordpressCustomizations #LearnWordpressStepbyStep #WordpressBySanjay Syntax, ============== wp_editor( string $content, string $editor_id, array $settings = array() ) Parameters ================ $content (string) (Required) Initial content for the editor. $editor_id (string) (Required) HTML ID attribute value for the textarea and TinyMCE. Can only be /[a-z]+/. $settings (array) (Optional) How we use, =========== 1. Define in HTML 2. Get value in javascript from editor 3. Save editor value to database 4. Read value from database and put into wp_editor Define in HTML page, --------------- $content = ''; $editor_id = 'onlinewebtutorid'; wp_editor( $content, $editor_id ); Save value of editor from html page to database ----------------- jQuery("#frmPost").validate({ submitHandler:function(){ var email = jQuery("#txtEmail").val(); var name = jQuery("#txtName").val(); // here is the way to send wp_editor value to library file var description = encodeURIComponent(tinyMCE.get("description_id").getContent()); var postdata = "action=custom_plugin_library¶m=savedata&email="+email+"&name="+name+"&desc="+description; jQuery.post(ajaxurl,postdata,function(response){ console.log(response); }) } }); Save value to database from library file: ------------------- $desc = isset($_REQUEST['desc']) ? htmlspecialchars($_REQUEST['desc']) : ""; Read Value to database and put into wp_editor content area ------------------- global $wpdb; $data = $wpdb-]get_row( $wpdb-]prepare("SELECT * from wp_custom_plugin order by id desc limit 1") ); wp_editor(html_entity_decode($data-]description), "description_id"); Documentation Study https://developer.wordpress.org/reference/functions/wp_editor/ 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/ Also you can learn Wordpress Custom =============== Wordpress Theme Development: https://goo.gl/MZ8maF Wordpress Widget Development: https://goo.gl/Dc2htn Wordpress Plugin Development: https://goo.gl/BA7dYG Wordpress Theme Options Development: https://goo.gl/Vjv3Ub Learn backbone.js here! : https://goo.gl/Qd2Pcs 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 :)
Download
0 formatsNo download links available.