• Resolved jhkoenig

    (@jhkoenig)


    Current behavior requires that someone click the CREATE button in the Yourls box after PUBLISHing a post. I have several actions hooked to the “draft to publish” and “future to publish” hooks and would like to add the creation of the Yourls shortlink too.

    What is the best way to do this?

    Thanks for the guidance. Love your plugin!
    –John

    https://ww.wp.xz.cn/plugins/yourls-link-creator/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Andrew Norcross

    (@norcross)

    How comfortable are you with writing code? There are some built in hooks and filters to access the process at different stages.

    Also, there is a checkbox on the settings page to auto-generate links on both publish and when scheduled content posts, so that may also solve the problem.

    Thread Starter jhkoenig

    (@jhkoenig)

    Hello Andrew, and thank you for your speedy reply!

    I am quite comfortable writing PHP code (30 years as a developer) so any internal hooks you can suggest will be greatly appreciated! I have built a subroutine in functions.php which schedules a series of tweets and Facebook posts when a post goes live, using custom meta fields. These all depend on your plug-in for the Yourls value.

    Really appreciate your help! Cheers!

    Plugin Author Andrew Norcross

    (@norcross)

    fantastic! in the admin.php file of the plugin, there is an action called yourls_after_url_save which passes the post ID and the newly generated short URL. That should cover all your use cases for using the shortlink and passing it to whatever other functions you’ve got.

    Thread Starter jhkoenig

    (@jhkoenig)

    Andrew, please forgive my delay in responding. Your suggestion was exactly what I needed! Thank you so much for writing and supporting such a great plug-in.

    Happy new year!
    –John

    Plugin Author Andrew Norcross

    (@norcross)

    fantastic! glad I could help.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Hook to create Yourls link?’ is closed to new replies.