Skip to content

Instantly share code, notes, and snippets.

@kasparsd
Created January 17, 2014 15:23
Show Gist options
  • Select an option

  • Save kasparsd/8475199 to your computer and use it in GitHub Desktop.

Select an option

Save kasparsd/8475199 to your computer and use it in GitHub Desktop.
Fix Metroshare to use the legacy sharer URL that doesn't require an App ID
<?php
/**
* Apperantly we need to use the legacy URL instead, because the new one
* doesn't work without a valid App ID
*/
add_filter( 'metroshare_destinations', 'fix_fb_sharing_location' );
function fix_fb_sharing_location( $destinations ) {
if ( isset( $destinations['facebook'] ) ) {
// Use legacy URL
$destinations['facebook']['action'] = 'https://www.facebook.com/sharer.php';
// Use legacy query param too
unset( $destinations['facebook']['hidden']['link'] );
$destinations['facebook']['hidden']['u'] = '{{link}}';
}
return $destinations;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment