Skip to content

wpt_shorten_link

github-actions[bot] edited this page Jun 14, 2026 · 1 revision

Make modifications to URLs prior to shortening.

Auto-generated Example

add_filter(
   'wpt_shorten_link',
    function(
        string $url,
        string $shortener,
        int $post_ID
    ) {
        // Your code here.
        return $url;
    },
    10,
    3
);

Parameters

  • string $url Full permalink URL to post.
  • string $shortener Shortener selected in settings.
  • int $post_ID Post ID.

Returns

string

Files

apply_filters( 'wpt_shorten_link', $url, $shortener, $post_ID )

← All Hooks

Clone this wiki locally