coresocial_button_args

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_button_args", $args );
Arguments
Name
Type
Description
$args
array
Merged button arguments, including network, module, item, item_id, url, real, labels, count settings, and data.
Returns
array — button arguments.

Runs before HTML escaping and tracking-signature generation, after count sorting. Change url for the destination and preserve real for the canonical tracked URL. Preserve unrelated keys and avoid reserved tracking attributes in data. Standard URL restrictions remain in effect. A non-array return leaves the arguments unchanged.

Example

add_filter( 'coresocial_button_args', function ( $args ) {
    if ( $args['network'] === 'reddit' ) {
        $args['accessible_label'] = 'Discuss this article on Reddit';
    }
    return $args;
} );
Rate this reference
0
0
3

You are not allowed to rate this post.

Leave a Comment

0
0
0
0
0
0
0
0
0