So I've created a few meta boxes using the wp_editor, all are exactly as the following:
add_action( 'add_meta_boxes', 'business_facts_metabox' );
function business_facts_metabox()
{
add_meta_box('business_facts', 'Business Facts', 'business_facts_output', 'page', 'normal', 'high');
}
function business_facts_output( $post )
{
//so, dont ned to use esc_attr in front of get_post_meta
$business_facts_value= get_post_meta($_GET['post'], 'business_facts' , true ) ;
wp_editor( htmlspecialchars_decode($business_facts_value), 'business-facts', $settings = array('textarea_name'=>'business-facts') );
}
function save_business_facts( $post_id )
{
if (!empty($_POST['business-facts']))
{
$data=htmlspecialchars($_POST['business-facts']);
update_post_meta($post_id, 'business_facts', $data );
}
}
add_action( 'save_post', 'save_business_facts' );
Unfortunately, when I output what is saved, it outputs everything, so it doesn't show bolds, instead if I were to output a bold word, it would output <strong>word</strong>, instead of word. I need it to output properly with styling and html working properly.
Is this possible using custom metaboxes? if so, what do I need to edit in my code?