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

Sharable Entries #329

Merged
merged 5 commits into from
Feb 15, 2018
Merged

Sharable Entries #329

merged 5 commits into from
Feb 15, 2018

Conversation

liamdefty
Copy link
Contributor

to be merged after milestone/1.7

A sharable link will be a link the the post with a hash of the entry id. When a user visits a url with a hash we will check if the entry id exists and jump to it on the front end using a similar approach and API to the jump to key events.

As it is more up to the theme developer to decide what social links they would like we do not include any on the actual entries by default. However here is a simple example of creating a share link to twitter:

add_filter( 'comment_text', function( $content, $comment ) {
	if ( $comment->comment_type === 'liveblog' ) {
		$share_link = get_permalink( $comment->comment_post_ID ).'#'.$comment->comment_ID;
		return $content.'<a href="https://twitter.com/intent/tweet?url='.urlencode( $share_link ).'">Share to Twitter</a>';
	} 

	return $content;
}, 10, 2 ); 

Copy link
Contributor

@philipjohn philipjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add the URL to each entry in a menu like the one I suggested on #328 for easy copying?

@liamdefty
Copy link
Contributor Author

@philipjohn This makes sense to do. Our designer, Ollie, suggested that we could follow a similar format to twitter where the date/time is a link to the entry, meaning you could copy the url from here.

image

What are your thoughts?

Copy link
Contributor

@philipjohn philipjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea!

@philipjohn philipjohn added this to the 1.8 milestone Jan 24, 2018
@philipjohn
Copy link
Contributor

Just a note that the failing tests are fixed in #344

@philipjohn philipjohn changed the base branch from master to 1.8-beta February 7, 2018 10:12
@philipjohn philipjohn merged commit ba7db00 into Automattic:1.8-beta Feb 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants