Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Centralizing News through WordPress REST API

172 views

Published on

UAMSHealth.com has used WordPress as their primary content management system for several years. In the last couple of years, they have started centralizing content areas to avoid duplication and errors. UAMSHealth.com serves as the primary hub for news at the University of Arkansas for Medical Sciences (UAMS). Their latest efforts involve syndicating the news through the WP Rest API. This session will cover how they started (syndication plugins that push posts to other sites), where they are now (content syndication of posts through REST), and where they are headed next (additional Custom Post Types and beyond).

Published in: Education
  • Be the first to comment

  • Be the first to like this

Centralizing News through WordPress REST API

  1. 1. Centralizing News through WordPress REST API Todd McKee, MEd University of Arkansas for Medical Sciences (UAMS)
  2. 2. Todd McKee, MEd @toddmckee Senior Web Developer Office of Communications and Marketing
  3. 3. Wordpress at UAMS • UAMSHealth.com (Hospital & News) • 9000+ posts & pages • uamsonline.com & uamsonlinedev.com (UAMS multisites) • 150 sites with ~400 users • uamsonlinetwo.com & uamsdev.com (Institutes) • 7 sites with 1500+ posts • sites.uams.edu & go.uams.edu (One-offs & Apps) • ~30 sites with ~200 users • 25+ of single installs (One-offs & special)
  4. 4. Before College of Medicine Research Cancer Institute Same (-ish) Story. Posted 3 times or more ✂+📋 ✂+📋 ✂+📋
  5. 5. Content Syndication • https://premium.wpmudev.org/blog/how-to- manage-the-content-in-your-wordpress- multisite-media-empire/ • https://vip.wordpress.com/plugins/syndication/
  6. 6. Now College of Medicine Same Story. Not all sites are available Cancer Institute Research ☑ ☑ Push 🚫
  7. 7. LEVEL UP: Merging All The Things https://online.wpcampus.org/schedule/level-up-centralized-news-and-wordpress/
  8. 8. Now Cancer Institute College of Medicine Research ☑ ☑ Push 🚫
  9. 9. Soon Cancer Institute College of Medicine Research One Story. Multiple sites Pull ☁ (Already Started)
  10. 10. • https://wpengine.com/resources/the-ultimate-guide-to-the-wordpress-rest-api/ • https://torquemag.io/2017/05/ways-start-using-wp-rest-api/ • https://jeremyfelt.com/2016/02/17/using-wp-rest-api-washington-state-university/ • https://github.com/washingtonstateuniversity/WSUWP-Content-Syndicate
  11. 11. WHAT IS AN API? Definition: Application Program Interface (API) is a set of routines, protocols, and tools for building software applications. YOU LOST ME AT “DEFINITION” An API lets you access, or create data. 
 WordPress Terms: The REST API lets you access, or create, WordPress content. https://www.slideshare.net/royssivan/wpcampus-online-the-case-for-the-wordpress-rest-api
  12. 12. HOW DO YOU API? Leveraging the API isn’t that difficult once you get the hang of JSON (JavaScript Object Notation) Use JavaScript or PHP RESTful API Representational state transfer (REST) or RESTful web services is an API that uses HTTP requests to GET, PUT, POST and DELETE data (Universal connector for data).
  13. 13. JSON
  14. 14. WP Rest API 101 • WordPress 4.7+ • v2.wp-api.org • CRUD (Create, Read, Update, Delete) • /wp-json/wp/v2/ https://www.slideshare.net/AndrewDixon5/an-absolute-beginners-guide-to-the-wordpress-rest-api
  15. 15. GET • /wp-json/wp/v2/posts • Example
  16. 16. Filter • Add parameters to filter • Think WP-Query • GET • /wp-json/wp/v2/posts?search=awesome • /wp-json/wp/v2/posts?page=1&per_page=2 • Example
  17. 17. Single Article • GET 
 /wp-json/wp/v2/posts/{POST-ID} • Example
  18. 18. What else can we access? • Pages • Media • Custom Post Types • Taxonomies • Everything…
  19. 19. Examples
  20. 20. Issues • Authentication • Basic, JavaScript, & Oauth • Cross-Origin Resource Sharing (CORS) • Extending Support For Custom Content Types
  21. 21. What are we doing? • News on www.uams.edu • Image on top of www.uams.edu • Alert system (WP API v1) • People / Physician directory (coming soon)
  22. 22. Thank you. Questions?
  23. 23. Resources • github.com/UAMS-Web • github.com/UAMS-Web/UAMSWP- Content-Syndication • github.com/washingtonstateuniversity • wpcampus.org

×