Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Largo post social links do not support Guest Authors' Twitter accounts #1117

Closed
benlk opened this issue Feb 3, 2016 · 2 comments
Closed
Assignees

Comments

@benlk
Copy link
Collaborator

benlk commented Feb 3, 2016

See: http://jira.inn.org/browse/WE-87

If a coauthor has a twitter account, the account used for the "via" text in the "Tweet" button is the twitter account of the person who created the post, not the coauthor.

@benlk benlk added the type: bug label Feb 3, 2016
@benlk benlk self-assigned this Feb 3, 2016
@benlk benlk added this to the hotfix milestone Feb 3, 2016
@aschweigert aschweigert added the priority: high Either blocks work on a priority-normal task or a solution here informs other work. label Feb 3, 2016
@aschweigert
Copy link

this is an urgent issue for WE-87 and should be addressed asap as a hotfix

@benlk
Copy link
Collaborator Author

benlk commented Feb 3, 2016

The author is a Guest Author with a twitter account set: http://womensenews.org/wp-admin/post.php?post=59538&action=edit

But none of this makes sense. https://github.com/INN/Largo/blob/master/inc/post-tags.php#L190

  • function coauthors_posts_links exists, I checked: Downloaded the copy of the plugin from production and grepped.
  • !isset( $values['largo_byline_text'] ) === true, so we're now in the part of largo_post_social_links that deals with coauthors
            if ( function_exists( 'coauthors_posts_links' ) && !isset( $values['largo_byline_text'] ) ) {
                $coauthors = get_coauthors( $post->ID );
                $author_twitters = array();
                foreach ( $coauthors as $author ) {
                    if ( isset( $author->twitter ) ) {
                        $author_twitters[] = $author->twitter;
                    }
                }
                if ( count( $author_twitters ) == 1 ) {
                    $via = '&via=' . esc_attr( largo_twitter_url_to_username( $author_twitters[0] ) );
                }
                // in the event that there are more than one author twitter accounts, we fall back to the org account
                // @link https://github.com/INN/Largo/issues/1088
            } else if ( !isset( $values['largo_byline_text'] ) ) {
                $user =  get_the_author_meta( 'twitter' );
                if ( !empty( $user ) ) {
                    $via = '&via=' . esc_attr( largo_twitter_url_to_username( $user ) );
                }
            }

I've included the else here because, though it should not be being used, the code that is apparently running is that.

Even when setting the post with more than one coauthor, the username output is that of the author, not the org's account. Something is causing it to go to the next option, and there's no rationale for it.


  • else if ( empty($via) && !isset( $values['largo_byline_text'] ) )

@benlk benlk modified the milestones: 0.5.5 - Story Elements, hotfix Feb 4, 2016
@benlk benlk removed the priority: high Either blocks work on a priority-normal task or a solution here informs other work. label Feb 4, 2016
aschweigert added a commit that referenced this issue Feb 7, 2016
…al-links

Attempted fixes for #1117, where post_author twitter account is used instead of coauthor
@benlk benlk closed this as completed Feb 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants