PHP Action Hooks – Customizing Your WordPress Social Media Automation

Estimated reading: 7 minutes 173 views

Bit Social PHP Action Hooks allow developers to execute custom code immediately after content has been published to social media platforms. Using these hooks, you can perform additional tasks—like logging publications, sending notifications, updating databases, or integrating with third-party services—without changing the core plugin files.

Here are some Bit Social PHP Action hooks:​

Description:

The bit_social_post_data action hook in Bit Social allows you to modify the post content and images before the data is shared to a connected social media platform. You can use this hook to customize the message, adjust formatting, or extract specific fields from custom post types.

apply_actions('bit_social_post_data', function ($data, $priority)

Usage:

The following example shows how to modify the submitted data before it is saved to the database.

add_action('bit_social_post_publish', 'customize_bit_social_post_publish', data, 2);

function customize_bit_social_post_publish($data, $priority) {
    // Modify the post data before sending to social platforms
 
    return $data;
}

Parameters:

  • $data (array): This is the post data that Bit Social prepares to send to social platforms.
  • priority (int): This is the ID of the WordPress post currently being processed.

Facebook:

The bit_social_facebook_post_publish action hook fires immediately after content is successfully published to Facebook. You can use this hook to log publication data, trigger notifications, or sync with other systems.

add_action('bit_social_facebook_post_publish', 'get_bit_social_facebook_data', 10, 2);
function get_bit_social_facebook_data($post_data, $response) {
    error_log(print_r(['facebook', $post_data, $response], true));
}

Parameters:

  • $post_data (array): This is the post data that was sent to Facebook.
  • $response (mixed): This is the API response received from Facebook after publishing.

LinkedIn:

The bit_social_linkedin_post_publish action hook executes after LinkedIn publication. Use it to track LinkedIn-specific publications or integrate with LinkedIn analytics.

add_action('bit_social_linkedin_post_publish', 'get_bit_social_linkedin_data', 10, 2);
function get_bit_social_linkedin_data($post_data, $response) {
error_log(print_r(['linkedin', $post_data, $response], true));
}

Google Business Profile

The bit_social_google_business_profile_post_publish action hook in Bit Social triggers immediately after content is successfully published to Google Business Profile (formerly Google My Business). You can use this hook for local SEO tracking, review management integration, or local business analytics.

add_action('bit_social_google_business_profile_post_publish','get_bit_social_google_business_profile_data', 10, 2);
function get_bit_social_google_business_profile_data($post_data, $response) {
    error_log(print_r(['google_business_profile', $post_data, $response], true));
}

Parameters:

  • $post_data (array): This is the post data that was sent to Google Business Profile.
  • $response (mixed): This is the API response received from Google Business Profile after publishing.

Discord:

The bit_social_discord_post_publish action hook fires after Discord message posting. Use it to trigger additional Discord webhooks or log channel activities.

add_action('bit_social_discord_post_publish', 'get_bit_social_discord_data', 10, 2);
function get_bit_social_discord_data($post_data, $response) {
    error_log(print_r(['discord', $post_data, $response], true));
}

Parameters:

  • $post_data (array): This is the post data that was sent to Discord.
  • $response (mixed): This is the API response received from Discord after publishing.

 Instagram:

The bit_social_instagram_post_publish action hook fires after Instagram content is posted. Perfect for Instagram-specific analytics or content tracking.

add_action('bit_social_instagram_post_publish', 'get_bit_social_instagram_data', 10, 2);
function get_bit_social_instagram_data($post_data, $response) {
    error_log(print_r(['instagram', $post_data, $response], true));
}
  • $post_data (array): This is the post data that was sent to Instagram.
  • $response (mixed): This is the API response received from Instagram after publishing.

Pinterest:

The bit_social_pinterest_post_publish action hook triggers after Pinterest pin creation. Use it to track pin analytics or update inventory systems.

add_action('bit_social_pinterest_post_publish', 'get_bit_social_pinterest_data', 10, 2);
function get_bit_social_pinterest_data($post_data, $response) {
    error_log(print_r(['pinterest', $post_data, $response], true));
}

Parameters:

  • $post_data (array): This is the post data that was sent to Pinterest.
  • $response (mixed): This is the API response received from Pinterest after publishing.

Threads:

The bit_social_threads_post_publish action hook fires after Threads publication. Use it for Threads-specific tracking or integrations.

add_action('bit_social_threads_post_publish', 'get_bit_social_threads_data', 10, 2);
function get_bit_social_threads_data($post_data, $response) {
    error_log(print_r(['threads', $post_data, $response], true));
}

Tumblr:

The bit_social_tumblr_post_publish action hook triggers after Tumblr blog post publication. Use it for Tumblr analytics or cross-posting workflows.

add_action('bit_social_tumblr_post_publish', 'get_bit_social_tumblr_data', 10, 2);
function get_bit_social_tumblr_data($post_data, $response) {
    error_log(print_r(['tumblr', $post_data, $response], true));
}

Parameters:

  • $post_data (array): This is the post data that was sent to Tumblr.
  • $response (mixed): This is the API response received from Tumblr after publishing.

Twitter/X:

The bit_social_twitter_post_publish action hook triggers after content is published to Twitter/X. Use it for tweet analytics or social listening integrations.

add_action('bit_social_twitter_post_publish', 'get_bit_social_twitter_data', 10, 2);
function get_bit_social_twitter_data($post_data, $response) {
    error_log(print_r(['twitter', $post_data, $response], true));
}
  • $post_data (array): This is the post data that was sent to Twitter/X.
  • $response (mixed): This is the API response received from Twitter/X after publishing.

Tiktok

The bit_social_tiktok_post_publish action hook in Bit Social triggers immediately after content is successfully published to TikTok. You can use this hook for TikTok analytics, video performance tracking, or short-form content strategy.

add_action('bit_social_tiktok_post_publish', 'get_bit_social_tiktok_data', 10, 2);
function get_bit_social_tiktok_data($post_data, $response) {
    error_log(print_r(['tiktok', $post_data, $response], true));
}

Parameters:

  • $post_data (array): This is the post data that was sent to TikTok.
  • $response (mixed): This is the API response received from TikTok after publishing.

Bluesky

The bit_social_bluesky_post_publish action hook in Bit Social triggers immediately after content is successfully published to Bluesky. You can use this hook for decentralized social media tracking, AT Protocol integrations, or fediverse analytics.

add_action('bit_social_bluesky_post_publish', 'get_bit_social_bluesky_data', 10, 2);
function get_bit_social_bluesky_data($post_data, $response) {
    error_log(print_r(['bluesky', $post_data, $response], true));
}

Line

The bit_social_line_post_publish action hook in Bit Social triggers immediately after content is successfully published to Line. You can use this hook for messaging app analytics, Japanese market tracking, or mobile engagement metrics.

add_action('bit_social_line_post_publish', 'get_bit_social_line_data', 10, 2);
function get_bit_social_line_data($post_data, $response) {
    error_log(print_r(['line', $post_data, $response], true));
}

Telegram

The bit_social_telegram_post_publish action hook in Bit Social triggers immediately after content is successfully published to Telegram. You can use this hook for channel analytics, bot integrations, or messaging platform tracking.

add_action('bit_social_telegram_post_publish', 'get_bit_social_telegram_data', 10, 2);
function get_bit_social_telegram_data($post_data, $response) {
    error_log(print_r(['telegram', $post_data, $response], true));
}

All Platforms Combined:

The bit_social_all_platforms_post_publish action hook fires after ANY platform publication, providing a single point for universal logging or tracking across all social networks.

add_action('bit_social_all_platforms_post_publish','get_bit_social_all_platforms_data', 10, 1);
function get_bit_social_all_platforms_data($post_data) {
    error_log(print_r(['all platforms', $post_data], true));
}

Share this Doc

PHP Action Hooks – Customizing Your WordPress Social Media Automation

Or copy link

CONTENTS