After editing/styling i save the post and this doesn't keep the styling instead give me plain text.
<?php
$content = get_post_meta($post->ID,'principle_duties',true);
$editor = 'principle_duties';
$settings = [
'textarea_rows' => 10,
];
wp_editor($content,$editor,$settings);
?>
//////////////////
if ( isset( $_POST['principle_duties'] ) ) {
update_post_meta( $post_id, 'principle_duties', sanitize_text_field( $_POST[ 'principle_duties' ] ) );
}
[
meta
principle_duties
definitely got the HTML in it, at the time of fetching it from the database? Can you see HTML in themeta
's value in the database?principle_duties
post meta.