Support

Account

Home Forums Bug Reports acf_get_value notice incorrect Reply To: acf_get_value notice incorrect

  • This:

    The notice is just suppressed when you wrap all code in acf/init hook but the return value is still incorrect, it’s different when using the key to get the value. It would return 1 instead of true

    is an indication that ACF is not finding the field key reference in order to get the field definition. It can also be caused by other filters, most notably pre_get_post filters.

    In the former case ACF stores a value of 1 in the DB for a true/false field. If it cannot locate the field definition then it returns whatever value is stored in the DB without formatting it correctly.

    The latter case can be very difficult to track down then exact cause.