Support » Plugin: YOURLS Link Creator » Auto Link Generation Fails from WordPress App

  • Brooke.

    (@bandonrandon)


    Howdy,

    I recently added Jetpack’s sharing buttons to my site and noticed that some shortlinks from YOURLS wasn’t being auto-added to the Tweet. Upon further review I noticed posts without custom were links were published via the WordPress App (Android).

    When publishing from WP-Admin the custom links are generated as expected. The quick fix was to click on “Generate YOURL” for each post published from the app. Once links were generated the sharing buttons worked as expected.

    To get Jetpack to use the shortlink I have added this to my site:

    function brookedotphoto_sharedaddy_shortlink( $url, $post_id ) {
        return wp_get_shortlink( $post_id );
    }
    add_filter( 'sharing_permalink', 'brookedotphoto_sharedaddy_shortlink', 10, 2 )

    (source: http://eth.pw/s )

    I plan to look into this a bit more latter but wanted to post here in case you had any ideas or this has come up before. My guess is that when posting from the app, the YOURLS hook is being skipped.

    To Replicate
    – Set up YOURLS Link Creator providing a valid secret and site setup.
    – Enable “Create a YOURLS link when a post is saved.”
    – Connect the site to the WordPress.com App (currently only tested with Andorid)
    – Publish a post and notice that a shortlink is not generated automatically.

    WordPress site: https://brooke.photo
    YOURLS site: https://brooke.link

    • This topic was modified 1 year, 6 months ago by  Brooke..
    • This topic was modified 1 year, 6 months ago by  Brooke..
  • The topic ‘Auto Link Generation Fails from WordPress App’ is closed to new replies.