Title: Davide Tommasin's Replies | WordPress.org

---

# Davide Tommasin

  [  ](https://wordpress.org/support/users/kinghack/)

 *   [Profile](https://wordpress.org/support/users/kinghack/)
 *   [Topics Started](https://wordpress.org/support/users/kinghack/topics/)
 *   [Replies Created](https://wordpress.org/support/users/kinghack/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/kinghack/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/kinghack/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/kinghack/engagements/)
 *   [Favorites](https://wordpress.org/support/users/kinghack/favorites/)

 Search replies:

## Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Field Template] [Plugin: Custom Field Template] Type text, date = true with multiple button don't work](https://wordpress.org/support/topic/plugin-custom-field-template-type-text-date-true-with-multiple-button-dont-work/)
 *  Thread Starter [Davide Tommasin](https://wordpress.org/support/users/kinghack/)
 * (@kinghack)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-custom-field-template-type-text-date-true-with-multiple-button-dont-work/#post-2311300)
 * I have found solution.
    Now I use wpalchemy for create custom metabox and custom
   fields.
 * [WPAlchemy](http://www.farinspace.com/wpalchemy-metabox/)
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [Custom category page display subcategories with posts](https://wordpress.org/support/topic/custom-category-page-display-subcategories-with-posts/)
 *  [Davide Tommasin](https://wordpress.org/support/users/kinghack/)
 * (@kinghack)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/custom-category-page-display-subcategories-with-posts/#post-1689152)
 * how can I use the variable $do_not_duplicate = $post-> ID in this loop for not
   having duplicate posts?
 * Best Regards
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Sendit WP Newsletter] WYSIWYG Sendit](https://wordpress.org/support/topic/wysiwyg-sendit/)
 *  Thread Starter [Davide Tommasin](https://wordpress.org/support/users/kinghack/)
 * (@kinghack)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/wysiwyg-sendit/#post-1967198)
 * “Version 1.5.9 fixes the Tinymce editor to appear in the newsletter section”
 * Yhea 🙂
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Sendit WP Newsletter] WYSIWYG Sendit](https://wordpress.org/support/topic/wysiwyg-sendit/)
 *  Thread Starter [Davide Tommasin](https://wordpress.org/support/users/kinghack/)
 * (@kinghack)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/wysiwyg-sendit/#post-1967157)
 * I now paste the html code that I create with the editor of posts.
    It’s very 
   frustrating work 🙁
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Sendit WP Newsletter] WYSIWYG Sendit](https://wordpress.org/support/topic/wysiwyg-sendit/)
 *  Thread Starter [Davide Tommasin](https://wordpress.org/support/users/kinghack/)
 * (@kinghack)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/wysiwyg-sendit/#post-1967156)
 * Sorry but I haven’t resolved it. 🙁
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Post Type UI] [Plugin: Custom Post Type UI] Add custom write panel don't work](https://wordpress.org/support/topic/plugin-custom-post-type-ui-add-custom-write-panel-dont-work/)
 *  Thread Starter [Davide Tommasin](https://wordpress.org/support/users/kinghack/)
 * (@kinghack)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-custom-post-type-ui-add-custom-write-panel-dont-work/#post-1792305)
 * Hi, web00132
 * I put this code on function.php and it work perfectly.
 *     ```
       function my_meta_init()
       {
       	// review the function reference for parameter details
       	// http://codex.wordpress.org/Function_Reference/wp_enqueue_script
       	// http://codex.wordpress.org/Function_Reference/wp_enqueue_style
   
       	//wp_enqueue_script('my_meta_js', MY_THEME_PATH . '/custom/meta.js', array('jquery'));
       	wp_enqueue_style('my_meta_css', MY_THEME_PATH . '/custom/meta.css');
   
       	// review the function reference for parameter details
       	// http://codex.wordpress.org/Function_Reference/add_meta_box
   
       	// add a meta box for each of the wordpress page types: posts and pages
       	foreach (array('post','page', 'books', 'movies') as $type)
       	{
       		add_meta_box('my_all_meta', 'My custom box', 'my_meta_setup', $type, 'normal', 'high');
       	}
   
       	// add a callback function to save any data a user enters in
       	add_action('save_post','my_meta_save');
       }
   
       function my_meta_setup()
       {
       	global $post;
   
       	// using an underscore, prevents the meta variable
       	// from showing up in the custom fields section
       	$meta = get_post_meta($post->ID,'_my_meta',TRUE);
   
       	// instead of writing HTML here, lets do an include
       	include(MY_THEME_FOLDER . '/custom/meta.php');
   
       	// create a custom nonce for submit verification later
       	echo '<input type="hidden" name="my_meta_noncename" value="' . wp_create_nonce(__FILE__) . '" />';
       }
   
       function my_meta_save($post_id)
       {
       	// authentication checks
   
       	// make sure data came from our meta box
       	if (!wp_verify_nonce($_POST['my_meta_noncename'],__FILE__)) return $post_id;
   
       	// check user permissions
       	if ($_POST['post_type'] == 'page')
       	{
       		if (!current_user_can('edit_page', $post_id)) return $post_id;
       	}
       	else
       	{
       		if (!current_user_can('edit_post', $post_id)) return $post_id;
       	}
   
       	// authentication passed, save data
   
       	// var types
       	// single: _my_meta[var]
       	// array: _my_meta[var][]
       	// grouped array: _my_meta[var_group][0][var_1], _my_meta[var_group][0][var_2]
   
       	$current_data = get_post_meta($post_id, '_my_meta', TRUE);	
   
       	$new_data = $_POST['_my_meta'];
   
       	my_meta_clean($new_data);
   
       	if ($current_data)
       	{
       		if (is_null($new_data)) delete_post_meta($post_id,'_my_meta');
       		else update_post_meta($post_id,'_my_meta',$new_data);
       	}
       	elseif (!is_null($new_data))
       	{
       		add_post_meta($post_id,'_my_meta',$new_data,TRUE);
       	}
   
       	return $post_id;
       }
   
       function my_meta_clean(&$arr)
       {
       	if (is_array($arr))
       	{
       		foreach ($arr as $i => $v)
       		{
       			if (is_array($arr[$i]))
       			{
       				my_meta_clean($arr[$i]);
   
       				if (!count($arr[$i]))
       				{
       					unset($arr[$i]);
       				}
       			}
       			else
       			{
       				if (trim($arr[$i]) == '')
       				{
       					unset($arr[$i]);
       				}
       			}
       		}
   
       		if (!count($arr))
       		{
       			$arr = NULL;
       		}
       	}
       }
       ```
   
 * Bye
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Post Type UI] [Plugin: Custom Post Type UI] Add custom write panel don't work](https://wordpress.org/support/topic/plugin-custom-post-type-ui-add-custom-write-panel-dont-work/)
 *  Thread Starter [Davide Tommasin](https://wordpress.org/support/users/kinghack/)
 * (@kinghack)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-custom-post-type-ui-add-custom-write-panel-dont-work/#post-1792277)
 * I find the solution 🙂
    It’s simple. I have used this code for implement meta
   box:
 *     ```
       // add a meta box for each of the wordpress page types: posts and pages and other custom post type
       	foreach (array('post','page', 'books', 'movies', 'products') as $type)
       	{
       		add_meta_box('my_all_meta', 'My custom box', 'my_meta_setup', $type, 'normal', 'high');
       	}
       ```
   

Viewing 7 replies - 1 through 7 (of 7 total)