Get meta fields by meta box id
Get meta fields by meta box id
Get meta fields by meta box id
You can use what you have with slight modification. Just increase the height of the meta box and let your users enter an item on each line. Embed $recipe_embed = get_post_meta( $post->ID, “recipe_embed”, true ); if ( ! empty( $recipe_embed ) ): ?> <div style=”background: green;”> <?php // normalize returns $recipe_embed = str_replace( “\n”, “\r”, … Read more
Controlling Meta Box Height
First of all you need prevent whole post form sending. Try: function rt_custom_button(){ $html=”<div id=”major-publishing-actions” style=”overflow:hidden”>”; $html .= ‘<div id=”publishing-action”>’; $html .= ‘<button onclick=”send_note(event);” accesskey=”p” tabindex=”5″ class=”button-primary” id=”custom” name=””>send media note</button>’; $html .= ‘</div>’; $html .= ‘</div>’; echo $html; } add_action( ‘post_submitbox_misc_actions’, ‘rt_custom_button’ ); Then you need to add JS function somewhere: function send_note(event){ event.preventDefault(); … Read more
How to add select list to meta box field?
Edit woocommerce product post type
Add Metabox to settings / options page
It is HTML and Javascript territory. For the image preview, you may need a input type=”file” with accept=”image/*” and onchange event handler for the preview and the javascript getElementById to get the image id to display for preview. Have a look at these examples. For the text preview part here is a fiddle link. It … Read more
Meta box are designed to work with Post(s) and Custom post types. However you can make it work on options page if you know what you are doing. Click here for sample code
Store multiple textarea data in database from a metabox