Home Forums Bug Reports acf/register_fields action for Location Field


acf/register_fields action for Location Field

  • Hi Elliot,

    I recently downloaded the Location Field from GitHub to include in my theme. It appears that the action to register the field is never being fired.

    Please see the issue I have outlined in the repo:

    Basically, if if I include the include_once('location-v4.php'); in the construct function the location field appears. Otherwise, it doesn’t show up in the latest version of ACF. This tells me that the add_action('acf/register_fields', array($this, 'register_fields')); is never firing.

    Any help is most appreciated!

  • Hi @devinwalker

    You say that you are including the location field within your theme. Have you tried using it as a WP plugin? Does it work in this state?

    Looking at the README it seems like there are incorrect instructions to use the add-on within your theme.

    In your functions.php file, just include the add-on like so:


    Does that fix the issue?

  • Yes the instructions in the readme should be updated to just include the file – or perhaps use if file_exists include(…); thanks for the resolution!

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

The topic ‘acf/register_fields action for Location Field’ is closed to new replies.