Skip to content

Instantly share code, notes, and snippets.

View AnnaMariaEriksson's full-sized avatar

Anna-Maria Eriksson AnnaMariaEriksson

  • Malmö, Sweden
  • 01:40 (UTC -12:00)
View GitHub Profile
@AnnaMariaEriksson
AnnaMariaEriksson / ugly-links-facebook-no-more.php
Created March 14, 2016 20:10
Get rid of ugly links on Facebook when sharing a post from WordPress via Publicize or some other fetching service.
@AnnaMariaEriksson
AnnaMariaEriksson / instagram.php
Last active June 21, 2016 14:33
Grab first sentence of from Instagram and make it a post title. Available for multiple categories with personal excerpts and create single WordPress posts without a plugin
add_action( 'save_post', 'save_post_wpse_87921', 10, 2 );
function strposa($haystack, $needles=array(), $offset=0) {
$chr = array();
foreach($needles as $needle) {
$res = strpos($haystack, $needle, $offset);
if ($res !== false) {
$chr[$needle] = $res;
}
}