Support

Account

Home Forums Feature Requests Filter default values

Helping

Filter default values

  • Hi ACF team!

    I love this plugin!!! Each update makes me fall in love with it all over again <3

    I just got around to playing with the Google Map field (I know, I am slow!) and I’d love to have a way to filter the default values for lat and lng. One reason is that I am lazy and would love to be able to filter this from my functionality plugin so I don’t have to think about it ever again.

    It might be useful for other field types as well.

    Thanks!

  • this is an old question, and I’m not sure when this was added, but the default values for every field can be set using and acf/load_field filter https://www.advancedcustomfields.com/resources/acfload_field/. The example on this page shows choices, but any field setting can be altered this way, although changing important values like key will cause you problems. To see the settings of any field just output them and you’ll be able to see what you can change.

    
    function my_load_field_filter($field) {
      echo '<pre>'; print_r($field); echo '</pre>';
      return $field;
    }
    

    Hope that helps anyone that’s looking for this type of thing.

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

The topic ‘Filter default values’ is closed to new replies.