XPoster icon
Social Media

XPoster hooks reference

  • By Joe Dolson
  • v5.1.1
  • Updated

XPoster 5.1.1 has 8 actions and 54 filters, read directly from its source code on Nov 17, 2026. The list updates automatically when a new version is released.

How to use these hooks

Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.

functions.phpyour child theme
// Run your own code when XPoster fires an action
add_action( 'wpt_custom_tab', function( $ID, $arg2 ) {
	// Your code runs here.
}, 10, 2 );

// Change a value XPoster is about to use
add_filter( 'wpt_custom_truncate', function( $post_update, $update, $post_ID, $repost, $arg5 ) {
	// Change $post_update here.
	return $post_update;
}, 10, 5 );

Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.

All hooks

  • wpt-truncate.php line 151 · used in 3 places
    /**
     * Filter an update template that does not contain any XPoster template tags.
     */
    apply_filters( 'wpt_custom_truncate', $post_update, $update, $post_ID, $repost, 1 );
  • services/bluesky/post.php line 147 · used in 3 places
    /**
     * Turn on staging mode. Staging mode is automatically turned on if
     * WPT_STAGING_MODE constant is defined.
     */
    apply_filters( 'wpt_staging_mode', false, $auth, $post_ID, 'bluesky' );
  • services/bluesky/post.php line 56 · used in 3 places
    /**
     * Add alt attributes to uploaded images.
     */
    apply_filters( 'wpt_uploaded_image_alt', $alt_text, $attachment );
  • includes/metabox.php line 153 · used in 2 places
    /**
     * Display the custom tab container in XPoster Pro.
     */
    do_action( 'wpt_custom_tab', $post->ID, 'visible' );
  • includes/metabox.php line 124
    /**
     * Generate fields after the custom template box in the meta box.
     */
    do_action( 'wpt_after_meta_template_box', $post->ID );
  • wpt-functions.php line 1052
    /**
     * Filter to allow Duplicate Posts plugin to copy XPoster meta data when a post
     * is duplicated.
     */
    apply_filters( 'wpt_allow_copy_meta', false );
  • wp-to-twitter.php line 1430
    /**
     * Return array of post types that can be sent as status updates.
     */
    apply_filters( 'wpt_allowed_post_types', $allowed_types, $post_type_settings );
  • includes/metabox.php line 165
    /**
     * Render actions relevant only when multiple users are enabled.
     */
    do_action( 'wpt_authors_tab', $post->ID, $selected );
  • wp-to-twitter.php line 1468
    /**
     * Return true if auto tweeting of old posts is enabled.
     */
    apply_filters( 'wpt_auto_tweet_allowed', $return, $post_id );
  • wpt-truncate.php line 588
    /**
     * Filter the output of a custom field template tag. Custom field tags are
     * marked with `[[$field]]`.
     */
    apply_filters( 'wpt_custom_shortcode', $value, $post_ID, $field );
  • wpt-truncate.php line 531
    /**
     * Filter the value of a custom template tag.
     */
    apply_filters( 'wpt_custom_tag', '', $post_ID );
  • wpt-rate-limiting.php line 115
    /**
     * Filter the default rate limit.
     */
    apply_filters( 'wpt_default_rate_limit', $limit, $term );
  • services/bluesky/post.php line 168
    /**
     * Filter the approval to send a Bluesky post.
     */
    apply_filters( 'wpt_do_bluesky_post', true, $auth, $post_ID, $status['text'] );
  • wp-to-twitter-shorteners.php line 129
    /**
     * 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.
     */
    apply_filters( 'wpt_do_shortening', false, $shortener, $url, $post_title, $post_ID, $testmode );
  • wpt_do_toot

    filter
    services/mastodon/post.php line 119
    /**
     * Filter the approval to send a Mastodon Toot.
     */
    apply_filters( 'wpt_do_toot', true, $auth, $post_ID, $status_text );
  • wpt_do_tweet

    filter
    services/x/post.php line 110
    /**
     * Filter the approval to send a Tweet.
     */
    apply_filters( 'wpt_do_tweet', true, $auth, $post_ID, $status['text'] );
  • wpt-functions.php line 720
    /**
     * Filter the sensitivity used to distinguish between new posts and edits.
     * Default allows up to a 10 second discrepancy in time stamps where post will
     * be treated as new. This is necessary because the post date and modified date
     * can sometimes different by a second on any server.
     */
    apply_filters( 'wpt_edit_sensitivity', 10 );
  • wp-to-twitter-manager.php line 316
    /**
     * Exclude post types from the list of available types to post to X.com.
     */
    apply_filters( 'wpt_exclude_post_types', $exclusions );
  • services/bluesky/post.php line 191
    /**
     * Filter status array for Bluesky.
     */
    apply_filters( 'wpt_filter_bluesky_status', $status, $post_ID, $auth );
  • services/mastodon/post.php line 136
    /**
     * Filter status array for Mastodon.
     */
    apply_filters( 'wpt_filter_mastodon_status', $status, $post_ID, $auth );
  • wp-to-twitter.php line 941
    /**
     * Return true to block this post based on POST data. Default false.
     */
    apply_filters( 'wpt_filter_post_data', false, $_POST );
  • wpt-truncate.php line 260
    /**
     * Filter a template tag value after truncation. If a value like an excerpt or
     * post content has been truncated, you can modify the output using this
     * filter.
     */
    apply_filters( 'wpt_filter_truncated_value', $new_value, $key, $old_value );
  • includes/post-info.php line 182
    /**
     * Change the taxonomy used by default to generate post tags. Array of terms
     * attached to post.
     */
    apply_filters( 'wpt_hash_source', $tags, $post_ID );
  • wp-to-twitter.php line 1284
    /**
     * Runs when post data is inserted.
     */
    do_action( 'wpt_insert_post', $_POST, $post_ID );
  • wpt-truncate.php line 47
    /**
     * Filter the max length array used for calculating status update truncation.
     */
    apply_filters( 'wpt_max_length', $values, $service );
  • wpt-functions.php line 784
    /**
     * Filter the attachment ID to post with a status update.
     */
    apply_filters( 'wpt_post_attachment', $attachment_id, $post_ID );
  • wpt_post_info

    filter
    includes/post-info.php line 111
    /**
     * Filters post array to insert custom data that can be used in status update
     * process.
     */
    apply_filters( 'wpt_post_info', $values, $post_ID );
  • wp-to-twitter.php line 1017
    /**
     * Execute an action when a status update is executed.
     */
    do_action( 'wpt_post_to_service', $post_ID, $post_info, $template );
  • wp-to-twitter.php line 311
    /**
     * Modify the expiration window for recent status updates. This value does
     * flood control, to prevent a runaway process from sending multiple status
     * updates. Default `30` seconds.
     */
    apply_filters( 'wpt_recent_tweet_threshold', 30 );
  • wp-to-twitter.php line 356
    /**
     * Filter whether a given post should be sent to a specific service.
     */
    apply_filters( 'wpt_service_enabled', $send_to, $post_ID, $service );
  • wpt_settings

    filter
    wp-to-twitter-manager.php line 276
    /**
     * Filter the printed message after updating XPoster settings.
     */
    apply_filters( 'wpt_settings', $message, $_POST );
  • wpt-functions.php line 267
    /**
     * Filter the array of tabs representings settings pages.
     */
    apply_filters( 'wpt_settings_tabs_pages', $pages, $current );
  • wp-to-twitter-shorteners.php line 441
    /**
     * Filter available shorteners.
     */
    apply_filters( 'wpt_shorteners', $shorteners, $shortener );
  • wp-to-twitter.php line 925
    /**
     * Apply filters against this post to determine whether it should be allowed to
     * be sent.
     */
    apply_filters( 'wpt_should_block_status', false, $post_info );
  • wpt-functions.php line 311
    /**
     * Disable the admin notice that shows the last sent update.
     */
    apply_filters( 'wpt_show_last_update', true );
  • includes/post-info.php line 243
    /**
     * Change the default tag character. Default '#'.
     */
    apply_filters( 'wpt_tag_default', '#', $t_id );
  • wpt_tags

    filter
    wpt-truncate.php line 396
    /**
     * Add a new template tag placeholder.
     */
    apply_filters( 'wpt_tags', array( 'url', 'title', 'blog', 'post', 'category', 'categories', 'date', 'author', 'displayname', 'tags', 'modified', 'reference', 'account', '@', 'cat_desc', 'longurl' ) );
  • wp-to-twitter.php line 596
    /**
     * Executes an action after posting a status fails.
     */
    do_action( 'wpt_tweet_failed', $connection, $post_ID, $notice );
  • wp-to-twitter.php line 607
    /**
     * Executes an action after a status is posted successfully.
     */
    do_action( 'wpt_tweet_posted', $connection, $post_ID );
  • wpt-truncate.php line 122
    /**
     * Filter a template prior to parsing tags.
     */
    apply_filters( 'wpt_tweet_sentence', $update, $post_ID );
  • wp-to-twitter.php line 976
    /**
     * Filter whether a post defaults to send updates on edit.
     */
    apply_filters( 'wpt_tweet_this_edit', $post_this, $_POST, $post_ID );
  • includes/post-info.php line 73
    /**
     * Filter the space separated list of category descriptions in #cat_descs#.
     */
    apply_filters( 'wpt_twitter_category_descs', $cat_descs );
  • includes/post-info.php line 63
    /**
     * Filter the space separated list of category names in #cats#.
     */
    apply_filters( 'wpt_twitter_category_names', $cats );
  • includes/media.php line 37
    /**
     * Filter the uploaded image size.
     */
    apply_filters( 'wpt_upload_image_size', $size );
  • includes/media.php line 151
    /**
     * Filter whether this post should upload media.
     */
    apply_filters( 'wpt_upload_media', $return, $post_ID );
  • wpt-truncate.php line 626
    /**
     * Filter custom user meta. User meta tags are marked with `{{$field}}`.
     */
    apply_filters( 'wpt_user_meta_shortcode', wp_strip_all_tags( get_user_meta( $auth_id, $field, true ) ), $auth_id, $field );
  • wp-to-twitter-shorteners.php line 84
    /**
     * Filter the default utm_medium argument in link analytics.
     */
    apply_filters( 'wpt_utm_medium', 'twitter' );
  • wp-to-twitter-shorteners.php line 94
    /**
     * Filter the default utm_source argument in link analytics.
     */
    apply_filters( 'wpt_utm_source', 'twitter' );
  • wpt_status

    filter
    wpt-truncate.php line 439 · used in 2 places
    apply_filters( 'wpt_status', $post['postTitle'], $post_ID, 'title' );
  • the_title

    filter
    includes/post-info.php line 90
    apply_filters( 'the_title', wp_unslash( $thisposttitle ), $post_ID );
  • wp-to-twitter-shorteners.php line 95
    apply_filters( 'wpt_analytics_arguments', array( 'utm_campaign' => $campaign, 'utm_medium' => $medium, 'utm_source' => $source, ), $post_ID );
  • wp-to-twitter.php line 763
    apply_filters( 'wpt_filter_terms', $continue, $args );
  • wpt_notes_tab

    action
    includes/metabox.php line 98
    do_action( 'wpt_notes_tab', $post->ID );
  • wpt-rate-limiting.php line 141
    apply_filters( 'wpt_rate_limit_taxonomies', array() );
  • wp-to-twitter-shorteners.php line 742
    apply_filters( 'wpt_save_shortener_settings', $message );
  • wpt_store_url

    filter
    wp-to-twitter-shorteners.php line 303
    apply_filters( 'wpt_store_url', $store_urls );
  • wp-to-twitter-shorteners.php line 318
    apply_filters( 'wpt_store_urls', true, $post_ID, $url );
  • wpt_user_text

    filter
    includes/metabox.php line 56
    apply_filters( 'wpt_user_text', '', $status );

Generated from XPoster's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.

Can't find the right hook?

We can build the customisation for you. Describe what you need: