coresocial_get_current_title
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_title", $title, $method );
coreSocial 4.0 — core/base/Method.php:233
Arguments
Name
Type
Description
$title
string|null
Current page title captured by the plugin before the optional site-name suffix.
$method
Dev4Press\Plugin\coreSocial\Base\Method
Calling sharing method.
Returns
string — Current-page title.
Filters the fallback/current page title. The optional website-name suffix is applied after this filter; a final null value becomes an empty string.
Use the post-title or term-title hook when the modification depends on the specific resolved WordPress object.
Example
add_filter( 'coresocial_get_current_title', function ( $title, $method ) {
return wp_strip_all_tags( (string) $title );
}, 10, 2 );