• hello, i have question about add_option() function

    what will heppen when i will try to add option, which already exists? will wordpress engine just update this option or will do nothing?

    i ask because i wonder if it is neccesary to write smth like that:

    if (!get_option(‘optname’)) add_option(‘optname’, ‘optvalue’);
    else update_option(‘optname’, ‘optvalue’);

    ?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘what if i will try to add option which already exists?’ is closed to new replies.