coresocial_network_twitter_link_account

Developer Knowledge Level

This content is intended for WordPress developers, and it may require coding knowledge of WordPress, PHP, and JavaScript. Code examples provided here may contain errors or needs some additional coding. Make sure to test the code before using it on a live website!

PHP
Definition
apply_filters( "coresocial_network_twitter_link_account", $account, $item_id );
coreSocial 4.0 — core/networks/Twitter.php:52
Arguments
Name
Type
Description
$account
string
Account resolved from settings and any local post/term override.
$item_id
int
Shared WordPress object ID, or 0 for a custom URL. The hook does not receive the item type.
Returns
string — Account included in the share link.

Runs while building a Twitter / X share link, after the network has resolved its configured account. It does not publish anything to the social network.

Use the account name without adding a leading @. Return an empty string to omit attribution.

Example

add_filter( 'coresocial_network_twitter_link_account', function ( $account, $item_id ) {
    return $account !== '' ? $account : 'example';
}, 10, 2 );
Rate this reference
0
0
2

You are not allowed to rate this post.

Leave a Comment

0
0
0
0
0
0
0
0
0