Support » Plugin: GEO my Wordpress » removing url from current location SHORTCODE

  • Resolved sohinc

    (@sohinc)


    Hello.. first of all i would like to say you have created an awesome plugin and i am needing a bit of help… i am using these following shortcodes[gmw_current_location display_by=”street”],[gmw_current_location display_by=”city”],[gmw_current_location display_by=”state”],[gmw_current_location display_by=”zipcode”] and by default they show up with hyperlink is there a way to use these shortcodes where the value of the shortcodes just shows up as plain text instead of with the hyperlink… i know this maybe easy fix but i am not sure how to do this so anyhelp in this regards would be very useful for me. thanks

    https://wordpress.org/plugins/geo-my-wp/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Eyal Fitoussi

    (@ninjew)

    Hello Sohinc,
    It is not possible “out of the box”. You will need to modify the core file ( I can tell you which one if you want ). However, the hyperlink is there for the user to update his current location. Without the link it won’t be possible ( unless automatically detected by GEO my WP ).

    Also, I am just carious to know why you use the shortcode multiple times ([gmw_current_location display_by=”street”],[gmw_current_location display_by=”city”],[gmw_current_location display_by=”state”],[gmw_current_location display_by=”zipcode”]). You can use one shortcode like:
    [gmw_current_location display_by=”street,city,state,zipcode”] if you want to display multiple address fields. Unless you use it this way for other reasons.

    Thread Starter sohinc

    (@sohinc)

    thanks a lot for your reply… yes you are right i need it for other reasons as i am using a script that requires this info separately and if geomywp gave me this info without adding url link and it was just plain text it would pick up all these fields… basically my script kinda looks like this… <div class=”embed” target=”web” width=”2000px” address=”123 main st” city=”dallas” state=”tx” zip=”75040″></div> so bascially for address i would just input this shortcode with street and it would work so to achieve this what i would need to do is make your plugins shortcode appear without the url link now i know you said if i did this then the address would not be able to get modified… so my idea to solve this would be… to just place a link next to the address that says something like Update Address which the users can click on to update the address instead of making the address itself into a link… thanks a lot for your help as this will help me out greatly if this can work out. thanks

    Plugin Author Eyal Fitoussi

    (@ninjew)

    So basically what you need are the values of the current location ( street, city and so on )?
    Regardless the use of the current location shortcode?

    Thread Starter sohinc

    (@sohinc)

    yes

    Thread Starter sohinc

    (@sohinc)

    basically i just need to be able to get the current location of the user without the url link so i can use the shortcode in my script so please let me know what modifications i should make to achieve this. thanks

    Plugin Author Eyal Fitoussi

    (@ninjew)

    The current location is being saved in cookies each time the user updates it.
    You can get it using:
    urldecode($_COOKIE[‘gmw_street]);
    urldecode($_COOKIE[‘gmw_city]);
    urldecode($_COOKIE[‘gmw_state]);
    urldecode($_COOKIE[‘gmw_zipcode]);

    Will that work for you?

    Anyway I think I will create a new shortcode in the next version of the plugin that allows to display only the current location without any link.

    Thread Starter sohinc

    (@sohinc)

    thanks a lot for this… but i am not very sure how i would insert the code you gave into this .. <div class=”embed” target=”web” width=”2000px” address=”123 main st” city=”dallas” state=”tx” zip=”75040″></div> … sorry my knowledge about php is limited so if you can sort of guide me. thanks

    Thread Starter sohinc

    (@sohinc)

    i think i figured this out… i just created shortcodes based on your info and then used them and it works perfectly.
    //[foobarstreet]
    function foobarstreet_func( $atts ){
    return urldecode($_COOKIE[‘gmw_street’]);
    }
    add_shortcode( ‘foobarstreet’, ‘foobarstreet_func’ );

    //[foobarcity]
    function foobarcity_func( $atts ){
    return urldecode($_COOKIE[‘gmw_city’]);
    }
    add_shortcode( ‘foobarcity’, ‘foobarcity_func’ );

    //[foobarstate]
    function foobarstate_func( $atts ){
    return urldecode($_COOKIE[‘gmw_state’]);
    }
    add_shortcode( ‘foobarstate’, ‘foobarstate_func’ );

    //[foobarzip]
    function foobarzip_func( $atts ){
    return urldecode($_COOKIE[‘gmw_zipcode’]);
    }
    add_shortcode( ‘foobarzip’, ‘foobarzip_func’ );

    thanks

    Plugin Author Eyal Fitoussi

    (@ninjew)

    Perfect!
    I was about to suggest the exact same thing.
    I am glad you got it working.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘removing url from current location SHORTCODE’ is closed to new replies.