Why wp_update_post strip slashes?

I’m trying to update the post_content:

<?php 
$something = '<a class="class_name" href="#">';
$my_post = array(
      'ID'           => 1,
      'post_content' => $something,
  );
  wp_update_post( $my_post );
?>

Could anyone tell me why this always strips slashes from the $something?
What can I do to avoid this situation and update it just as it’s in $something?

Read more here: Why wp_update_post strip slashes?

Leave a Reply

Your email address will not be published. Required fields are marked *