Support

Account

Home Forums Add-ons Options Page Options Values in functions.php

Helping

Options Values in functions.php

  • I read another thread where a user was having problems getting custom fields from the options page on functions.php because it loads earlier than the ACF plugin. I believe this was resolved in your latest update of the plugin, however I still cannot get it to work.

    I am using an access code for user registration and it basically checks if the access code they entered is equal to the value of the access code on the options page.

    I am using ACF Version 4.3.5
    Options Page Version 1.2.0

    Should I be able to get ACF options in functions.php or is that not fully integrated yet?

    Thank you very much for any help!

  • You’ve probably either figured this out after 2 years or you’ve moved on, but for anyone with a similar problem. When doing this type of check it’s usually best to do it on ‘init’. The functions you’re trying to access may not be ready until after that point and there are some aspects of ACF that will not function properly until after the ‘init’ hook.

    
    add_action('init', 'my_init_function');
    function my_init_function() {
      // run your checks here
    }
    
Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Options Values in functions.php’ is closed to new replies.