WordCamp Joburg 2017 Composer Workshop

Composer has been around for a little while now and it has made the lives of thousands of PHP developers around the world just a little better (OK, quite a lot better). Using Composer in your theme and/or plugin will allow you to add a range of great features and libraries that are available to the general PHP community without having to worry about actually managing those libraries (Composer does that for you). In this workshop, we will look at: how Composer works from a very high...

Continue reading

WordCamp Cape Town 2017 Composer Workshop

I had the privilege of doing a workshop at WordCamp Cape Town 2017 on Composer and WordPress. I covered how we can use Composer to manage WordPress projects and how we could create parity between the different environments we have (like development, staging and production). Tools I used: Composer Bedrock What I would have liked to have clarified before the workshop was that this was for entire project management and not managing a single plugins dependencies (something that I think I’m...

Continue reading

Setting the PHP version in command line on CPanel Servers

Over the last couple of days, I’ve been really struggling to try to get Composer to install a project on a CPanel server. As you know, Composer can also check environment constraints and for some reason  php -v would show PHP 7.1 but when running composer install or php composer install, it would say that I’m using PHP 5.6. I tried using the full path to both PHP and Composer (to find that out, you can use which php and which composer) with no luck. After a...

Continue reading

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

WordCamp Joburg – Want to setup an online store?

Here are my slides from my workshop from WordCamp Joburg 2016. Most of the content was covered in the workshop (not on the slides) but the slides might give you a good idea of the flow. The stuff you’d really care about is most likely where to get the software that we used. Here are the things we used in the workshop: WooCommerce (WordPress Repo Plugin Directory) PayFast Extension Storefront Remember, you don’t have to use these plugins but they’re a good store. You can...

Continue reading