GithubHelp home page GithubHelp logo

chrisbuchholz / acf-coordinates Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stupidstudio/acf-coordinates

0.0 2.0 0.0 107 KB

Adds a coordinates field to Advanced Custom Fields. This field allows you to find the coordinates of a location.

PHP 44.17% CSS 7.85% JavaScript 47.98%

acf-coordinates's Introduction

Advanced Custom Fields Coordinates

This add-on to Advanced Custom Fields (ACF) makes it easy to add coordinates to your posts by choosing the location on a visual map or by searching for an address.

We developed at it Stupid Studio because we felt that the existing alternatives โ€” like ACF { Location Field โ€” were lacking and that we could do better.

This software is licensed under the GNU General Public License version 3. See gpl.txt included with this software for more detail.

Usage

Backend

Install this plugin by downloading the source and unzipping it into the plugin folder in your WordPress installation. Make sure to also have ACF installed.

Then when you create a new custom field with ACF, set the field type to Coordinates map. Now the coordinates chooser should show up when you edit a post with your custom fields.

Frontend

To get the coordinates data in your frontend, simply request the field value and in return you get the latitude, longitude and the address.

<?php
$values = get_field('*****FIELD_NAME*****');
$lat = $values['lat'];
$lng = $values['lng'];
$address = $values['address'];

Address is not the exact, correct name of the location. Instead it is the term you wrote when searching for the coordinates.

acf-coordinates's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.