and like us on FB

There’s a group of committed WordPress enthusiasts, bloggers, and developers that get together in most cities around the world for regular meetups. They group talks about their WordPress projects, list to guest speakers, and build upon features for the WP core. While I’ve never attended a local meet (partly because we have so many of our own), I’m keen to attend one in the future. To ensure I keep abreast of future dates, we built a little shortcode (utilizing the WP API ) that will render upcoming meets into a WordPress post or page.

We’ve listed Australian and local Sydney meets on a reference page. The shortcode on this website will permit you to do the same.

The Result

The next 5 meets in Sydney can be rendered with the shortcode of [wpmeets number="5" location="Sydney"]. The result:

WordPress Shortcode

Copy and paste the WordPress function into your theme's functions.php file or, if you sensibly have one installed, your custom functions plugin. You may optionally download and install our plugin from the bottom of of the page.

If you require shortcode to work in a sidebar widget, you'll have to enable the functionality with a filter. If you're using our custom functions plugin, you'll have that feature enabled by default.

Shortcode Attributes

The following shortcode attributes are available.

location

You must specify a location. To determine if the location is supported by WordPress’ system, simply query the API in your browser with your location of choice. The location of Sydney and Australia both work for us.

dateformat

If our date formatting isn’t to your liking, alter it in the shortcode function or as an attribute. Alter by way of PHP’s date() formatting.

number

If not defined, the API will return 10 results. Alter with number="20".

offline

If the WordPress API is offline, we’ll display this message.

cache_temp

If the WordPress API is offline, we’ll wait cache_temp before trying again. In the meantime, the above message will be displayed.

cache

The cache period is the time to cache results. We cache for 24 hours by default.

PHP Function

Used outside of WordPress, the following function may be used. Usage requires Simple Cache. Other than the location, arguments are passed to the function in an array.

Considerations

  • WordPress lists API examples as listed below. Because you can search by geographical coordinates, you might consider applying our IP to location API and rendering results for specific locales, or resolving to the region or country level.

https://api.wordpress.org/events/1.0
https://api.wordpress.org/events/1.0/?number=3
https://api.wordpress.org/events/1.0/?location=Seattle
https://api.wordpress.org/events/1.0/?location=Australia
https://api.wordpress.org/events/1.0/?latitude=51.051&longitude=13.738
https://api.wordpress.org/events/1.0/?ip=136.0.16.1
https://api.wordpress.org/events/1.0/?country=IT

  • Since this article was written, WordPress has released V4.8 of the platform. The dashboard now includes local meets by default.

Display WordPress Meetups With Shortcode or a PHP Function

Meetups displayed in the WP Dashboard.

  • It’s likely we’ve missed various meetup types (camps, etc- not that it really matters). When they’re shown we’ll update the shortcode.

Download

Title: Display WordPress Meetups With a Shortcode or PHP Function
Description: Display WordPress Meetups With a Shortcode or PHP Function. Renders WordPress meetups in a specific area. Results are cached for 24 hours.
Download: Shortcode (V0.1) | WP Plugin (V0.1) | PHP Code (V0.1)

Shortt URL for this post: http://shor.tt/Am7