WordPress Articles from David Hayes

David B. Hayes is co-owner of WPShout. He's been using WordPress since 2007, and has a mature love (like an old married couple) for the content managment system. He's done loads of client work with it, uses it on a variety of personal projects, and generally thinks it's worth most people keeping it in their toolbox.

In addition to WordPress, he's into cycling, board games, and civic tech (running Code for Fort Collins). He also loves coffee and write about it at LowKeyCoffeeSnobs.com. And lastly (for this space) he writes about code beyond WordPress at Thoughtful Code.


Where and How to Use WordPress Hooks in Objects

You’ve maybe noted that we’ve recently been writing about WordPress and object-oriented programming in PHP a lot. Just last week, Fred published an article about PHP magic methods, especially __construct, and how they work. This week I want to tackle a very common and oft-debated question about WordPress and OOP: when I use WordPress hooks, where do they go on my objects?


How to Use get_the_author_meta in WordPress to Show Author Info

Your author’s are the heart of most WordPress sites. They write your content, engage with your audience, and generally make the site work as it should. As such, you’ll often want to get WP author meta from the site so that you can show it off in your template. The way to get meta author tag information from WordPress is a handy function called get_the_author_meta (or, if you don’t need to do any processing, the_author_meta). Using this function is a great way to get the author meta fields from your WordPress users, and show those author fields in your WordPress theme templates.



Two ways to build Gutenberg Blocks

Our friend Jason Bahl has put together one of the most quietly exhaustive tutorials I’ve seen on what it’s like to actually make a “Gutenblock” with all the code bits and where all of them go. One of my biggest uncertainties about Gutenberg is how many WordPress developers will need to be creating Gutenberg block and how easy they will find it. All of that points to the fact that regardless of how it turns out we’ll need a lot of different good tutorials about making Gutenblocks and the subtleties of that process.



How to Audit User Behavior with a WordPress Activity Log

In the Quick Guide we’ll use WP Security Audit Log to keep an activity log of what’s happening on our WordPress site. Activity logs are a chronological list of records of what logged in users did on your WordPress sites and multisite networks. A WordPress activity log a vital part of site security and management because in them, you can find a user log full of information about user logins—from where they logged in and when, what content they have created, published, modified and deleted, what user profile and WordPress settings changes other administrators have done, and much more.


What is “Thoughtful Code?”

A sort-of goal of starting my Thoughtful Code hobby site was to use it it say a little more on theory than “here’s how to set up Java projects” or “here are five cool things you didn’t know about PHP.” I love articles like that (and should write more of them), but they don’t speak to the name or concept of what makes code worth writing and what makes it valuable to the word. And that’s something I think about a lot, both in our work here with WordPress, and with my role in Code for Fort Collins.