Continuous Integration with WordPress

Get Custom Post Type by Slug

I recently had a case where I needed to get the post object for a custom post type in WordPress – I had to do this by a slug that the user passed in. There is a function ( get_page_by_path) which I initially thought was to only find the post object for pages but it actually goes deeper. The function takes 3 arguments: The path/slug that you’re looking for. How you want the post to be returned – basically as an array or object. The post type(s) you want to search...

Continue reading

Continuous Integration with WordPress

What is continuous integration and what does it have to do with WordPress?

CONTINUOUS INTEGRATION WITH WORDPRESS SERIES This is the first part of a 6-part series of posts about continuous integration with WordPress. You can find out more information about why I’m doing this here. What is continuous integration and what does it have to do with WordPress? Using Github and Travis CI to begin your continuous integration journey What is the difference between unit tests and integration tests? Writing unit tests to improve your code Writing integration tests and...

Continue reading