Support

Account

Home Forums Bug Reports acf/register_fields action for Location Field

Solved

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: https://github.com/elliotcondon/acf-location-field/issues/17

    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!

    • Elliot

    • July 12, 2013 at 4:43 pm

    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:

    
    include_once('acf-location/acf-location.php');
    

    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)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.