[wordpress插件] Advanced Custom Fields – Location Field add-on高级自定义字段–位置字段附加组件

wordpress 插件 文章 2020-02-07 05:20 505 0 全屏看文

AI助手支持GPT4.0

评分

100

100

描述

This is an add-on for the Advanced Custom Fields

这是高级自定义字段的附加组件

WordPress plugin and will not provide any functionality to WordPress unless Advanced Custom Fields is installed

WordPress插件,除非安装了高级自定义字段,否则不会为WordPress提供任何功能

and activated.

并激活。

The Location field provides:

“位置”字段提供:

    • a search field where you can type in some coordinates or an address and hit Enter.

    • 一个搜索字段,您可以在其中输入一些坐标或地址,然后按 Enter

    • a Google map which you can click at the desired location.
    • 您可以在所需位置单击的Google地图。

    In both cases, Google will find the location and return the coordinates and the complete address, if you want it complete.

    在这两种情况下,Google都会找到该位置并返回坐标和完整的地址(如果需要的话)。

    A marker will be added at the desired location.

    标记将添加到所需位置。

    Source Repository on GitHub

    GitHub上的源存储库

    https://github.com/julienbechade/acf-location-field

    https://github.com/julienbechade/acf-location-field

    Bugs, Questions or Suggestions

    错误,问题或建议

    https://github.com/julienbechade/acf-location-field/issues

    https://github.com/julienbechade/acf-location-field/issues

    Usage

    用法

    Make sure you read the Advanced Custom Fields's documentation first.

    确保首先阅读高级自定义字段的文档。

    p>

    >

    Back-end

    后端

    The Location field comes with 3 options:

    “位置”字段带有3个选项:

      1. The map address let you choose the value(s) to return on the front-end:

      2. 通过地图地址,您可以选择要在前端返回的值:

          • Coordinates & address
          • 坐标和地址

          • Coordinates
          • 坐标

        • The map center let you set the coordinates used to center the initial blank map.
        • 地图中心使您可以设置用于将初始空白地图居中的坐标。

        • The map zoom.
        • 地图缩放。

      Front-end

      前端

      Retrieving the value(s) on the front-end differs according to the Map address options.

      根据“映射地址”选项,检索前端的值不同。

        • Coordinates & address
           

        • 坐标和地址
           

          $location = get_field(‘location’);

          $ location = get_field(‘location’);

          echo $location[‘address’];

          echo $ location [‘address’];

          echo $location[‘coordinates’];

          echo $ location ['coordinates'];

        • Coordinates
           

        • 坐标
           

          the_field(‘location’);

        • the_field(‘location’);

安装步骤

The Location Field plugin can be used as a WordPress plugin or included in other plugins or themes.

“位置字段”插件可以用作WordPress插件,也可以包含在其他插件或主题中。

There is no need to call the Advanced Custom Fields register_field() method for this field.

无需为此字段调用高级自定义字段 register_field()方法。

    • WordPress plugin

    • WordPress插件

        1. Download the plugin and extract it to /wp-content/plugins/ directory.
        2. 下载插件并将其解压缩到 / wp-content / plugins / 目录。

        3. Activate the plugin through the Plugins menu in WordPress.
        4. 通过WordPress中的插件菜单激活插件。

      1. Added to Theme or Plugin

      2. 已添加到主题或插件

          1. Download the plugin and extract it to your theme or plugin directory.
          2. 下载插件并将其解压缩到主题或插件目录。

          3. Include the location-field.php file in you theme’s functions.php or plugin file.
               

          4. 在主题的 functions.php 或插件文件中包含 location-field.php 文件。
               

            include_once( rtrim( dirname( FILE ), ‘/’ ) . ‘/acf-location-field/location-field.php’ );

          5. include_once(rtrim(dirname( FILE ),‘/’)。‘/acf-location-field/location-field.php’);

下载地址

https://downloads.wordpress.org/plugin/advanced-custom-fields-location-field-add-on.zip

https://downloads.wordpress.org/plugin/advanced-custom-fields-location-field-add-on.zip

-EOF-

AI助手支持GPT4.0