Support » Developing with WordPress » Difference between of_get_option and get_option?

  • maxlefou

    (@maxlefou)


    Hi.
    I’m working on an old theme to update it to the latest standards and in some functions i see some of_get_option()

    So far these calls works perfectly as expected in functions.php.
    Thought, they don’t when it’s in a php file inside the inc folder. But changing of_get_option() into get_option() makes them work.

    I checked everywhere on the docs and on the web but i don’t find any real infos about of_get_option(). Does it do the same thing as get_option()? What are the differences? is of_get_option() being deprecated or something?

    Thanks for the replies.

Viewing 1 replies (of 1 total)
  • Yes I’ve searched the WordPress codebase and it seems that of_get_option() is not a WordPress core function. It could be a custom function inside a theme or some plugin.

    For best practice, please only use WordPress core functions when needed in your theme. This means that for fetching data from the WordPress database options table you should be using get_option.

Viewing 1 replies (of 1 total)
  • The topic ‘Difference between of_get_option and get_option?’ is closed to new replies.