coresocial_get_post_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_post_title", $title, $post, $method );
coreSocial 4.0 — core/base/Method.php:145
Arguments
Name
Type
Description
$title
string|null
Title resolved by the plugin before the optional site-name suffix.
$post
WP_Post
Resolved post object.
$method
Dev4Press\Plugin\coreSocial\Base\Method
Calling sharing method.
Returns
string — Title used in the sharing context.

Filters the post title before the Append website name option is applied. Return a plain-text title and preserve the object-specific context.

The final method converts a null result to an empty string. This hook does not change the WordPress post title stored in the database.

Example

add_filter( 'coresocial_get_post_title', function ( $title, $post, $method ) {
    return wp_strip_all_tags( (string) $title );
}, 10, 3 );
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