Display user HTML on website

You may need to un-escape the output. Take a look at html_entity_decode or similar functions before outputting to the screen.

$orig = "I'll \"walk\" the <b>dog</b> now";

$a = htmlentities($orig);

$b = html_entity_decode($a);

echo $a; // I'll &quot;walk&quot; the &lt;b&gt;dog&lt;/b&gt; now

echo $b; // I'll "walk" the <b>dog</b> now

html_entity_decode

function MKWD_Display_Westmor_Bottom_Left() {
  $westmor_customers_options = get_option( 'westmor_customers_option_name' );
  return html_entity_decode ( $westmor_customers_options['homepage_bottom_left_widget_0'] );
}

htmlspecialchars_decode

function MKWD_Display_Westmor_Bottom_Left() {
  $westmor_customers_options = get_option( 'westmor_customers_option_name' );
  return htmlspecialchars_decode ( $westmor_customers_options['homepage_bottom_left_widget_0'] );
}

wp_specialchars_decode

function MKWD_Display_Westmor_Bottom_Left() {
  $westmor_customers_options = get_option( 'westmor_customers_option_name' );
  return wp_specialchars_decode ( $westmor_customers_options['homepage_bottom_left_widget_0'] );
}

stripslashes

function MKWD_Display_Westmor_Bottom_Left() {
  $westmor_customers_options = get_option( 'westmor_customers_option_name' );
  return stripslashes ( $westmor_customers_options['homepage_bottom_left_widget_0'] );
}

Leave a Comment