coresocial_get_post_url

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_get_post_url", $url, $post, $method );
Arguments
Name
Type
Description
$url
string
Post permalink.
$post
WP_Post
Post object.
$method
Dev4Press\Plugin\coreSocial\Base\Method
Current sharing method.
Returns
string — post permalink.

Filters a post permalink. From coreSocial 4.0, featured-image URLs are filtered separately through coresocial_get_post_image. Migrate any image-specific branch in an existing coresocial_get_post_url callback to the dedicated image hook, registering it for four arguments. The old image call is no longer made.

Example

add_filter( 'coresocial_get_post_url', function ( $url, $post, $method ) {
    return remove_query_arg( 'utm_source', $url );
}, 10, 3 );
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