Add link_url hardcode setting to settings page
-
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 = ”;
}
}
- The topic ‘Add link_url hardcode setting to settings page’ is closed to new replies.