-
I am trying to make a plugin and i checked the hook list several times and tried different filters but none have worked. I want to modify the original long url the user enters. The one url that the short url will redirect to So with a filter I can add anything as a prefix to the original url |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 11 replies
-
The function called when shortening a new URL is Here, there isn't indeed a straightforward An easy alternative is to hook to one of the numerous filters already called within this function or within functions called by this function (for instance |
Beta Was this translation helpful? Give feedback.
The function called when shortening a new URL is
yourls_add_new_link()
Here, there isn't indeed a straightforward
$url = yourls_apply_filter("some_hook", $url);
That might be added, for instance after the
yourls_do_action( 'pre_add_new_link', $url, $keyword, $title );
to filter the submitted URL, keyword and title.An easy alternative is to hook to one of the numerous filters already called within this function or within functions called by this function (for instance
yourls_sanitize_url()
...)