Support » Plugin: Social » Tokens : How Add the excerpts ?

  • Resolved Dido Match

    (@dido-match)


    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/

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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!

    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

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Tokens : How Add the excerpts ?’ is closed to new replies.