WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] HTML Code Inside Theme Option Input Fields? (3 posts)

  1. norbiu
    Member
    Posted 4 years ago #

    I'm trying to add some simple html code inside one of the inputs of a theme option:

    <span class="abc">

    I can add it without the quotes, and it works, but it doesn't validate. Any ideas?

  2. Mark / t31os
    Moderator
    Posted 4 years ago #

    Try single quotes? Or try escaping the quotes..

    <span class='abc'>
    <span class=\"abc\">
  3. norbiu
    Member
    Posted 4 years ago #

    I used stripslashes for calling the info from the theme options

    <?php
      global $options;
      foreach ($options as $value) {
        if (stripslashes(get_option( $value['id'] )) === FALSE) { $$value['id'] = $value['std']; }
        else { $$value['id'] = stripslashes(get_option( $value['id'] )); }
        }
    ?>

    and htmlspecialchars() for the value of the input inside the options.

Topic Closed

This topic has been closed to new replies.

About this Topic