How to stop wordpress from mangling HTML in a metabox textarea

I’v re-worked your code. I’ll try to explain some of the changes after the code block add_action(“admin_menu”, “tf_book_deets_create”); function tf_book_deets_create(){ add_meta_box(‘tf_book_details’, ‘Book Details’, ‘tf_book_details’, ‘books’); } function tf_book_details () { global $post; $tf_book_media = get_post_meta($post->ID, “tf_book_media”, true); $tf_book_review = get_post_meta($post->ID, “tf_book_review”, true); ?> <div class=”admin_meta”> <ul> <li><label>Reviews:</label><textarea rows=”5″ cols=”70″ name=”tf_book_review”><?php echo esc_textarea($tf_book_review); ?></textarea></li> <li><label>Media:</label><textarea rows=”5″ … Read more

How do I display Youtube/Vimeo video ID on custom post type when user enters it in custom meta box?

Do you have custom post type videos? if not change videos to post add_meta_box( ‘my-meta-box-id’, ‘Enter Video ID’, ‘cd_meta_box_cb’, ‘post’, ‘normal’, ‘high’ ); Your code is fine but you are not saving the video type select box you just updated the id input field. Place this code in add_action(‘save_post’, ‘cd_meta_box_save’); if( isset( $_POST[‘my_meta_box_text’] ) && … Read more

Multiple Checkboxes Metabox

I was racking my brains out with this too and was finally able to find a solution that works. This should work for you, I’ve tested quickly. I’ll present it in 3 parts: PART 1: ADD THE CUSTOM META BOX add_action( ‘add_meta_boxes’, ‘add_custom_box’ ); function add_custom_box( $post ) { add_meta_box( ‘Meta Box’, // ID, should … Read more

Custom metabox translation

take a look at Internationalizing Your Plugin codex entry to get a better understanding of WordPress Translations. and read I18n for WordPress Developers after that you will know that if you coded your custom post types and metaboxes the right way with Translatable strings , all plugins work in the same way of looking for … Read more

Calculate Repeater Meta Box Input Field Values and Display Total

You need to loop through the values of each input and add them together. You can do this using a each. Try this. Replace your calculate function with this. calculate = function(){ var total = 0; $(‘.wpp-repeater-input’).each(function () { total += parseInt($(this).val()); }); document.getElementById(‘wpp_investment_total’).value = parseInt(total); } On a side note: I would remove the … Read more

custom meta box data not saved

So actually, for posts of the type attachment, you should use the edit_attachment (action) hook and not save_post_attachment: add_action( ‘edit_attachment’, ‘save_image_link’ ); // use edit_attachment //add_action( ‘save_post_attachment’, ‘save_image_link’ ); // not save_post_attachment Secondly, your meta box is not currently displaying the meta value, so you should display the value in the input field, and you … Read more

Create a page Meta Box listing all blog users

If someone wants to clean this up, all the better, but it gets the job done 🙂 If I understood you correctly, you need the ID for the user, yes? For more info on $wp_user_query check out this post which was a partial resource for me writing this code: http://www.mattvarone.com/wordpress/list-users-with-wp_user_query/ // List Users add_action(“admin_init”, “users_meta_init”); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)