Forums

testing if settings field has been updated (1 post)

  1. woodenpier
    Member
    Posted 1 year ago #

    I currently have an options page associated with my theme that registers settings and I have a few settings fields there. I am able to validate them and update the db... so all seems like it;s working from that end.

    To use these in my theme, I call something like:

    <?php $options = get_option('theme_options'); ?>
    <?php echo $options['option_name']; ?>

    but I would like to add an if statement to check and see if a particular field has been filled.

    I tried the following, but it isn't working.

    <?php if ( get_option ( 'option_name' )) { //do something } ?>

    I need to get to the field name somehow... I've been searching for a while and there are many tutorials on building a settings page - but not many on using the new options afterward. Any help would be appreciated.

Topic Closed

This topic has been closed to new replies.

About this Topic