WordPress.org

Ready to get started?Download WordPress

Forums

Simple Twitter Connect
Modifying autotweet syntax (1 post)

  1. locworks
    Member
    Posted 3 years ago #

    I'm trying to modify the way autotweets are generated.

    Currently the syntax is "%title%: %url%" and it's defined in stc_get_default_tweet($id)

    I'd like to add post tags to autotweets

    Desired syntax: %title% %url% %tags%

    I've fiddled with the code in stc-publish.php by adding get_the_tags, but instead of the tags I get "Array".

    Current code (lines 185-188)
    $output = $options['publish_text'];
    $title = str_replace(' ',' ', get_the_title($id));
    $output = str_replace('%title%', $title, $output );
    $output = str_replace('%url%', $link, $output );

    My code
    `$output = $options['publish_text'];
    $title = str_replace(' ',' ', get_the_title($id));
    $tags = str_replace(' ',' ', get_the_tags($id));
    $output = str_replace('%title%', $title, $output );
    $output = str_replace('%url%', $link, $output );
    $output = str_replace('%tags%', $tags, $output );

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic