WordPress.org

Ready to get started?Download WordPress

Forums

Geolocation
How to get default "off" to geolocation when creating a new post (3 posts)

  1. tinokremer1
    Member
    Posted 3 years ago #

    Is there a way to get geolocation to default to "off"? I use it occasionally, usually on my android phone. I installed the plugin to make the geolocation visible. I don't need it on most of my posts though and now I have to disable it everytime.

    Thanks, keep up the good work.

  2. Ricard Torres
    Member
    Posted 3 years ago #

    +1

    Would be nice to have that option in the settings page.

    Regards

  3. jopher91
    Member
    Posted 3 years ago #

    Not sure if this is a feature or a bug, but the fix is easy enough if you're willing to edit the code of geolocation.php

    I think the problem is that when 'public' and 'geolocation-on' are unset (as they are for new posts) the code that checks their values returns an empty string: but we're only setting posts to be non-public and off if the value is explicitly '0'.

    In the code for the function admin_head(), look for the line:

    if(public == '0')

    and change it to

    if((public == '0') || (public == ''))

    Then make a similar change five lines down:

    if((on == '0') || (on == ''))

    (I guess changing the 'public' default is optional; I did, but you might not want to.) I agree, I hope a 'default off' becomes available on the settings page.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic