WordPress.org

Ready to get started?Download WordPress

Forums

Social
[resolved] Tokens : How Add the excerpts ? (3 posts)

  1. Dido Match
    Member
    Posted 1 year ago #

    Hello !

    The settings for Social don't allow you to choose the excerpt as something to post to FB or twitter

    How you would like posts to be formatted when broadcasting to Twitter or Facebook?
    Tokens:

    {url} - Example: http://wp.me/p1D6F4-1PY
    {title}
    {content}
    {date} - Example: 2012-10-26 23:40:57
    {author}

    We would like to broadcast the excerpts only

    how add this ?

    thank you

    http://wordpress.org/extend/plugins/social/

  2. fruey
    Member
    Posted 10 months ago #

    I don't know if this is the best way to do it, but hacking service.php in the social/lib directory to add these lines works :

    break; /* already there */
    case '{excerpt}':
    	$content = $post->post_excerpt;
    	$content = htmlspecialchars_decode(strip_tags($content));
    	break;
    case '{author}': /* already there */
    ;

    (somewhere around line 410)

    and then adding in social.php (root of plugin)

    '{content}' => '',
    '{excerpt}' => '', /* add this line around line 151 */
    '{date}' => sprintf(__('Example: %s', 'social'), $date),

    People who customise excerpts are very likely to want to use them instead of the post content I think!

  3. Alex King
    Member
    Plugin Author

    Posted 9 months ago #

    One-off customizations should use the included hooks and the WordPress API:

    http://codex.wordpress.org/Plugin_API

    Enhancements/bug fixes that make sense to be included in the overall distribution can be submitted as a pull request here:

    https://github.com/crowdfavorite/wp-social

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic