Support » Plugin: AddToAny Share Buttons » Add link_url hardcode setting to settings page

  • Resolved jonalmada

    (@jonalmada)


    Hi – I’d like to ask for a modification to the plugin so we can put in a custom URL as the linkurl parameter at the settings page rather than me having to do this in the add-to-any.php file. You currently get this information from the local server and I have to override it for my situation. I’m generating static pages for publication to production sites and this was the only way I could get the plugin to work. I’m using the “Simply Static” plugin to generate static pages and this is what I do now to fix it:

    // Set linkurl
    if ( ! $linkurl ) {
    if ( $use_current_page ) {
    $linkurl = esc_url_raw( home_url( $_SERVER[‘REQUEST_URI’] ) );
    // Custom change by Jon to fix URL so static pages with with this plugin
    $linkurl = str_replace(“mydomain.local”,”com”,$linkurl);
    } elseif ( isset( $post ) ) {
    $linkurl = get_permalink( $post->ID );
    $linkurl = str_replace(“mydomain.local”,”com”,$linkurl);
    } else {
    $linkurl = ”;
    }
    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author micropat

    (@micropat)

    Instead of that (or, rather, changing the shared URL using AddToAny Events), you should “Convert all URLs for your WordPress site to absolute URLs at the domain specified above” in Simply Static settings.

    AddToAny works great with that awesome Simply Static feature, and so will a lot of other plugins.

    Hey thanks a lot – I’ll give that a go! Thank you so much!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.