• Resolved teejayuu

    (@teejayuu)


    I am writing my first plugin and everything’s working fine. I am now writing an admin panel for it following the instructions in the codex, but have hit a problem. I have added the options to the database but am struggling to read them into the panel. This is the code
    <h2>TJs Options</h2>
    <fieldset name="set1">
    <legend><?php _e('Display Name', 'Localization name') ?></legend>
    <table><tr>
    <td><b>Display Name</b></td><td> <input type="text" name="tj_sn_title" value=<?php get_option('tj_sn_name') ?> /></td>
    </tr></table>
    </fieldset>

    Using this code displays the legend the title and the text box containing a forward slash – when it should contain the phrase Test Text (stored in the database).
    I thought the get_option($option) hook retrieved data from the options table. What am I doing wrong

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter teejayuu

    (@teejayuu)

    Sorry, I forgot to echo the get_option($option) hook, so this is partly working. I am now only getting the first word of the phrase. Any ideas?

    Could be that you didn’t enclose the ‘value’ attribute in quotes:

    value="<?php echo get_option('tj_sn_name') ?>" />

    Thread Starter teejayuu

    (@teejayuu)

    Thabks Kafkaesqui – all sorted

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘First plugin help please’ is closed to new replies.