meta-boxes

How to create meta box using clone ajax and jquery in wordpress

此生再无相见时 提交于 2019-12-06 16:18:07
问题 I want to create 4 meta-box in a post(at Admin post panel) using clone ajax and jquery. I also need to add "add-more" and "remove" functionalities. 回答1: Hello Try this code I tried this in mine. Its working It creates Four Meta-boxes in Post(admin panel wordpress) add_action( 'add_meta_boxes', 'dynamic_add_custom_box' ); /* Do something with the data entered */ add_action( 'save_post', 'dynamic_save_postdata' ); /* Adds a box to the main column on the Post and Page edit screens */ function

WordPress: How to show a metabox on any admin page?

南楼画角 提交于 2019-12-05 16:13:42
I already know how to register metaboxes for Posts, Page, and Custom Post Types, but I would like to register a metabox to be shown on my custom admin page, which is not a post. My plugin has an " Options Page " in the WordPress Admin – I would like to show metaboxes on this very page. Is this possible? If yes, how can this be acheived? I saw in the add_meta_box documentation that one of the possible values for the $post_type parameter is dashboard , however this is not documented anywhere. I guess it would show the metabox on the WordPress Dashboard (the main admin screen when logging-in),

Editing Custom product tab content in Woocommerce Admin product pages

痴心易碎 提交于 2019-12-05 03:06:21
问题 In WooCommerce, I would like to add custom global product tab just like additional info when a new product is created. I am able to create new tab but cannot update anything on create new product page. I can see it on display page but how to add info through product edit page. I know I can use custom fields but I am looking to have it on product page to allow shop manager or others to fill this additional shipping tab. My Code is add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab' )

Saving all values in “multiple select”

感情迁移 提交于 2019-12-02 20:12:19
问题 im having a metabox in wordpress with a mutliple select form. <select name="my_meta_box_select" id="my_meta_box_select" multiple="" style="width:300px; height:400px;"> <option value="red">Red </option> <option value="blue">Blue </option> </select> So far so good, the selected value gets saved and I am able to retrieve it, however I wish for both values to be saved. For example I wish to save both red AND blue and be able to retrieve it from the frontend. Is there any way to achieve this? Are

Saving all values in “multiple select”

◇◆丶佛笑我妖孽 提交于 2019-12-02 09:59:42
im having a metabox in wordpress with a mutliple select form. <select name="my_meta_box_select" id="my_meta_box_select" multiple="" style="width:300px; height:400px;"> <option value="red">Red </option> <option value="blue">Blue </option> </select> So far so good, the selected value gets saved and I am able to retrieve it, however I wish for both values to be saved. For example I wish to save both red AND blue and be able to retrieve it from the frontend. Is there any way to achieve this? Are there better forms than a select? The purpose is for a user to select pages from one select field to

how to add a meta box to wordpress pages

走远了吗. 提交于 2019-12-01 00:54:17
问题 i want to make this code for pages add_action( 'add_meta_boxes', 'meta_box_video' ); function meta_box_video() { add_meta_box( 'video-meta-box-id', 'Video Embed', 'meta_box_callback', 'post', 'normal', 'high' ); } function meta_box_callback( $post ) { $values = get_post_custom( $post->ID ); $selected = isset( $values['meta_box_video_embed'] ) ? $values['meta_box_video_embed'][0] : ''; wp_nonce_field( 'my_meta_box_nonce', 'meta_box_nonce' ); ?> <p> <label for="meta_box_video_embed"><p>Video

Adding programmatically a custom settings tab to admin product data in WooCommerce

∥☆過路亽.° 提交于 2019-11-30 22:43:53
I want to programmatically add a settings tab to Product data metabox like this: The "Verzendkosten" tab was added with firebug (which means "Shipping costs) . How would I programmatically add the "Verzendkosten" custom tab in woocommerce edit-product pages settings? (and How would I be abled to populate it with data?) Updated on November 2017: Corrected some mistakes, cleaned and added available options Added 'Usage' and 'naming conventions' for custom fields slugs, at the end. 1) You create a custom tab in the custom post type Metabox (Here for "product"), 2) then you can add fields to

Adding programmatically a custom settings tab to admin product data in WooCommerce

Deadly 提交于 2019-11-30 17:46:12
问题 I want to programmatically add a settings tab to Product data metabox like this: The "Verzendkosten" tab was added with firebug (which means "Shipping costs) . How would I programmatically add the "Verzendkosten" custom tab in woocommerce edit-product pages settings? (and How would I be abled to populate it with data?) 回答1: Updated on November 2017: Corrected some mistakes, cleaned and added available options Added 'Usage' and 'naming conventions' for custom fields slugs, at the end. 1) You

How to add wysiwyg editor in Wordpress meta box

末鹿安然 提交于 2019-11-28 07:27:30
I'm creating a meta box for my custom post type. There are multiple fields where I would like to use wysiwyg editor rather than <textarea> . Is is possible to add multiple editors to a meta box? I would really appreciate your help! Many thanks. Dasha Here is full code example: add_action( 'add_meta_boxes', function() { add_meta_box('html_myid_61_section', 'TITLEEEEE', 'my_output_function'); }); function my_output_function( $post ) { $text= get_post_meta($post, 'SMTH_METANAME' , true ); wp_editor( htmlspecialchars_decode($text), 'mettaabox_ID', $settings = array('textarea_name'=>'MyInputNAME')

How to add wysiwyg editor in Wordpress meta box

天涯浪子 提交于 2019-11-27 01:54:06
问题 I'm creating a meta box for my custom post type. There are multiple fields where I would like to use wysiwyg editor rather than <textarea> . Is is possible to add multiple editors to a meta box? I would really appreciate your help! Many thanks. Dasha 回答1: Here is full code example: add_action( 'add_meta_boxes', function() { add_meta_box('html_myid_61_section', 'TITLEEEEE', 'my_output_function'); }); function my_output_function( $post ) { $text= get_post_meta($post, 'SMTH_METANAME' , true );