Skip to content

wpt_do_shortening

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

Apply a custom shortener to your status update. Return false to allow the settings to parse the URL or a URL to shortcircuit plugin settings.

Auto-generated Example

add_filter(
   'wpt_do_shortening',
    function(
        bool $shrink,
        string $shortener,
        string $url,
        string $post_title,
        int $post_ID,
        bool $testmode
    ) {
        // Your code here.
        return $shrink;
    },
    10,
    6
);

Parameters

  • bool $shrink False prior to shortening.
  • string $shortener Shortener selected in settings.
  • string $url Full permalink URL to post.
  • string $post_title Title of source post.
  • int $post_ID Post ID.
  • bool $testmode True if running a test of XPoster.

Returns

string

Files

apply_filters( 'wpt_do_shortening', false, $shortener, $url, $post_title, $post_ID, $testmode )

← All Hooks

Clone this wiki locally