coresocial_get_current_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_current_url", $url, $method );
coreSocial 4.0 — core/base/Method.php:221
Arguments
Name
Type
Description
$url
string
Current URL after the configured ignored query arguments and paging adjustments.
$method
Dev4Press\Plugin\coreSocial\Base\Method
Calling sharing method.
Returns
string — Current-page URL.
Runs in the current-page URL resolver, after the plugin has applied its Share URLs settings. It is distinct from the post and term permalink filters.
Use it when the current/custom page URL needs normalization. It does not change the browser location or remove the requirement for a valid tracking context.
Example
add_filter( 'coresocial_get_current_url', function ( $url, $method ) {
return remove_query_arg( 'preview_token', $url );
}, 10, 2 );