Support

Account

Home Forums ACF PRO Options Page prepends options field with 'options_'. Needs documentation.

Helping

Options Page prepends options field with 'options_'. Needs documentation.

  • This is a feature request / improvement

    The storage of options data should be documented to explain to the developer that option keys are prefixed with options_.

    This is useful not only to account for character limitations on key names in the database but also should the developer want to retrieve and option using native WordPress functions.

    Expected result

    When creating an ACF field belonging to an options page you would expect the key name for that option to be exactly that which you enter when creating the field. For example creating a text field belonging to an options page with a key of venue_name would imply that value can be grabbed by calling get_option( 'venue_name' );

    Actual Result

    Upon saving a value on an options page the key (using the example above) is prepended with options_. This means to call the actual option you would need to do get_option( 'options_venue_name' );

    Suggestion

    Through searching and looking on the documentation I believe:

    – This is not documented anywhere
    – There appears to be no hook / filter to change this behaviour or prefix

    It would be ideal if the above could be added to the documentation, preferably somewhere here: https://www.advancedcustomfields.com/resources/get-values-from-an-options-page/ or https://www.advancedcustomfields.com/resources/options-page/

    Notes

    This occurs in a multisite environment in WordPress 4.7.3 and ACF Pro V 5.5.11 with any type of options page, I believe this to be default behaviour regardless of environment.

  • Can you open a new support ticket for this so that it can be directed to the developer https://support.advancedcustomfields.com/new-ticket/.

    As a side note, their isn’t any documentation that I know of that tells you how fields are stored. The basic fields are easy to figure out, but things like repeaters and flex fields, not so easy to find information on. options with “options_” added to them confused me at first as well.

    This is a pretty good post on the subject that I found the other day, although is was written before the term meta was added to ACF.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Options Page prepends options field with 'options_'. Needs documentation.’ is closed to new replies.