Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Apostrophes being escaped on options page output WordPress

  • SOLVED

http://www.pandagaming.com.au/
The content is not run off posts but is from a wordpress options panel.
The content being saved in the options panel is escaping ' this and outputing /'

How can I add a function to eliminate this problem.

This is sample of how items are retrieved:
<div class="pic"></div><?php $pandagaming_01_title = get_option('pandagaming_01_title'); ?><?php $pandagaming_01_desc = get_option('pandagaming_01_desc'); ?>
<div class="box"> <span id="lobster3" class="greendark"><?php echo $pandagaming_01_title; ?></span>
<p><?php echo $pandagaming_01_desc; ?></p>
</div>


As you see there is no wordpress loop.

Answers (2)

2011-01-20

John Cotton answers:

<p><?php echo esc_attr($pandagaming_01_desc); ?></p>


pandragon comments:

Tried that didn't seem to budge the /'
do I need to define esc_attr in functions?


pandragon comments:

<?php echo stripslashes($pandagaming_01_title); ?>

Worked a treat! Thanks John :) Wouldn't have gotten there without you!


John Cotton comments:

Sorry, stripslashes was what I meant - esc_attr goes the other way.....it's too late in the day!!!!

2011-01-21

Sébastien | French WordpressDesigner answers:

Turner off the magic_quote