php - How can I extend Quick Edit option with 2 more fields -
I wonder if WordPress gives me the ability to add 2 fields (input and textarea) in Quick Edit < Tags Code> Actually, you want to add these 2 fields to code: I tried to do this but these codes are not saving data, and after doing all this it is a mess. Does this work If there is any way, please tell me. Provides lots of code useful to hook you in the Wordpress Quick Editing menu for customization. Quick Edit which edit tag pages , But I can use these 2 fields as quick edit so I can use them easily.
// Add a dummy column 'Post' post for post type post add_filter ('manage_edit-post_tag_columns',' add_dummy_column ', 102); Function add_dummy_column ($ column) {$ columns ['headline'] = 'title'; $ Column ['intro-text'] = 'intro text'; Return $ column; } // But delete it again on the edit screen (on other screen?) Add_filter ('manage_edit-post_tag_columns', 'remove_dummy_column'); Function remove_dummy_column ($ column) {unset ($ column ['description']); Return $ column; } Function my_column_value ($ empty = '', $ custom_column, $ term_id) {include_once ('taxonomy-metadata.fp'); Return esc_html (get_term_meta ($ word_id, $ custom_column, true)); } Add_filter ('manage_post_tag_custom_column', 'my_column_value', 10, 3); Function my_quick_edit_custom_box ($ column_name, $ screen, $ name) {if ($ name! = 'Post_tag' & amp; $ column_name! = 'Headline' $ $ column_name! = 'Intro-text')); If ($ name == 'post_tag' & amp; amp; $ column_name == 'title') {? & Gt; & Lt; Fieldset & gt; & Lt; Div id = "my-custom-content" class = "inline-edit-col" & gt; & Lt; Label & gt; & Lt; Span class = "title" & gt; & Lt ;? Php if ($ column_name == 'title') _e ('headline', 'ie_tag_plugin'); Other _e ('Identity lesson', 'ie_tag_plugin'); ? & Gt; & Lt; / Span & gt; & Lt; Span class = "input-text-wrap" & gt; & Lt; Input name = "& lt ;? php echo $ column_name ;? & gt;" Class = "ptitle" value = "" type = "text" & gt; & Lt; / Span & gt; & Lt; / Labels & gt; & Lt; / Div & gt; & Lt; / Fieldset & gt; & Lt ;? Php} if ($ name == 'post_tag' & amp; $ column_name == 'intro-text') {? & Gt; & Lt; Fieldset & gt; & Lt; Div id = "my-custom-content" class = "inline-edit-col" & gt; & Lt; Label & gt; & Lt; Span class = "title" & gt; & Lt ;? Php if ($ column_name == 'title') _e ('headline', 'ie_tag_plugin'); Other _e ('Identity lesson', 'ie_tag_plugin'); ? & Gt; & Lt; / Span & gt; & Lt; Span class = "input-text-wrap" & gt; & Lt; Textarea name = "& lt ;? php echo $ column_name ;? & gt;" Class = "ptitle" & gt; & Lt ;? Php $ data = esc_html ($ data); ? & Gt; & Lt; / Text field & gt; & Lt; / Span & gt; & Lt; / Labels & gt; & Lt; / Div & gt; & Lt; / Fieldset & gt; & Lt ;? Php}} add_action ('quick_edit_custom_box', 'my_quick_edit_custom_box', 10, 3); Function my_save_term_meta ($ term_id) {$ allow_html = array ('b' = & gt; array (), 'em' = & gt; array (), 'i' => array (), 'strike' = & Array (), 'Strong' => Array (),); If (isset ($ _ POST ['headline'])) update_term_meta ($ term_id, 'headline', wp_kses ($ _post ['headline'], $ permissions_primary)); If (isset ($ _ POST ['intro-text'])) update_term_meta ($ term_id, 'intro-text', wp_kses ($ _ POST ['intro-text'], $ permissions_intervanced)); } Add_action ('edited_post_tag', 'my_save_term_meta', 10, 1);
Comments
Post a Comment