Long/Lat Custom Field Meta

This topic contains 2 replies, has 3 voices, and was last updated by  Kiran 3 years, 2 months ago.

  • Author
    Posts
  • #381040

    Mike Marchese
    Expired Member
    Post count: 4

    Hello,
    I have spend hours trying to figure out how I can expose the longitude and latitude meta in the backend.

    I understand that these coordinates are stored in the Data Table and would not not accessible in the listings custom field meta out-of-the-box.

    I’ve included this is in my snippet plugin with no success.

    $lat = geodir_get_post_meta($post_id, 'post_latitude', true);
     $lng = geodir_get_post_meta($post_id, 'post_longitude', true);

    Am I missing something?

    I’d like to make these meta fields available to my site’s other plugins.

    I apologize if my question is at all naive- I’ve spent days trying to troubleshoot this issue to avoid hiring a developer, for what seems to be a fairly simple task.

    Thank you in advance.

    #381067

    Kor
    Moderator
    Post count: 16516

    Hi Mike,

    Could you tell us a little bit more about what you’re trying to achieve there?

    Thanks!

    #381223

    Kiran
    Moderator
    Post count: 7069

    Hi Mike,

    The code of lines you posted is correct to get listing latitude & longitude. But make sure the $post_id is belongs to one of GD listing.

    Thanks,
    Kiran

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

The topic ‘Long/Lat Custom Field Meta’ is closed to new replies, this may be for inactivity, please open a new topic if you have a similar question.