WordPress.org

Making WordPress.org

Opened 4 years ago

Last modified 16 months ago

#659 assigned enhancement

Add Website and Twitter fields to Speakers post type / shortcode

Reported by: iandunn Owned by:
Milestone: Priority: low
Component: WordCamp Site & Plugins Keywords: good-first-bug needs-patch
Cc:

Description

It'd be good to provide attendees with more information about speakers, by adding links to their website and Twitter profile when displaying their bio via the [speakers] shortcode.

We should add input fields for each to the Speaker post type, and then display the links underneath the bio if they exist. e.g.,

Jane Doe

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin finibus hendrerit lacus, elementum pharetra velit aliquet non. Donec auctor lacus quis lectus aliquet tincidunt. Ut nisl nisl, pretium in mauris in, congue tincidunt elit. Cras hendrerit, arcu sit amet aliquet aliquet, eros metus ultrices mi.

Website | Twitter

Attachments (1)

659.diff (6.7 KB) - added by BrashRebel 4 years ago.
Changes made to wc-post-types.php plugin for WordCamp sites.

Download all attachments as: .zip

Change History (7)

@BrashRebel
4 years ago

Changes made to wc-post-types.php plugin for WordCamp sites.

#1 follow-up: @BrashRebel
4 years ago

  • Cc kyle@… added
  • Keywords has-patch dev-feedback added

Added in two new fields in the speaker info meta box. Then added show_links to $attr and output the two new links in the shortcode.

I'm wondering if this could be enhanced and simplified by retrieving the website and Twitter links from the user's .org profile. Would that be a good idea?

#2 in reply to: ↑ 1 @iandunn
4 years ago

Replying to BrashRebel:

I'm wondering if this could be enhanced and simplified by retrieving the website and Twitter links from the user's .org profile. Would that be a good idea?

That's a really good idea. One potential drawback is that some speakers will have multiple websites or Twitter accounts, and might want the flexibility to feature a different one for different camps.

That's probably an edge case, though, and wouldn't outweigh the benefit of organizer's not having to manually ask for and enter data that we can grab automatically. It will also probably increase the number of speaker posts that actually have data, since we won't be relying on speakers and organizers to do extra work.

So, lets remove the fields and grab the data automatically, then cache it. It should be pulled whenever the username on the post changes, and also when the cache is older than 24 hours.

The best way to handle the cache is to always display the cached data, even if it's stale. We don't want to slow down the page load waiting on a remote service. If it is stale, though, we should kick off an asynchronous request for new data, and then update the cached value if that request succeeds. The updated value will then be available for the next page load.

#3 @iandunn
4 years ago

Oh, I forgot to mention, profiles.wordpress.org doesn't collect Twitter usernames, it just pulls them from Gravatar's API, so that's why we'll need a remote request.

The other sticking point is that the URL stored in the WordPress.org account is the value from the wordpress.org/support profile, not the profiles.wordpress.org profile. Ideally we want to use the profiles.wordpress.org value, since wordpress.org/support profiles will be going away eventually (see #518).

Profiles.WordPress.org doesn't have an API to pull user data. WordCamp.org could query the Profiles database to get the info, but that wouldn't work on sandboxes, so I tempted to just say let's use the WordPress.org account value, and it'll eventually be synced w/ Profiles once the support profiles are decommissioned.

#4 @iandunn
3 years ago

  • Keywords needs-patch added; has-patch dev-feedback removed

#5 @iandunn
3 years ago

  • Owner set to iandunn
  • Status changed from new to accepted

#6 @iandunn
16 months ago

  • Owner iandunn deleted
  • Status changed from accepted to assigned
Note: See TracTickets for help on using tickets.