WP Gotcha #1: Passing an empty array as a WP_Query parameter

With this article, I would like to start a series called WP Gotchas. In it, I will describe some problems you might and probably will run into as a WordPress plugin developer – if you haven’t already. At one point I was caught off-guard by them. Maybe this post will help you if you ever… Continue reading WP Gotcha #1: Passing an empty array as a WP_Query parameter

Count total number of items in nested arrays in PHP

Today I was working on some code that had arrays structured like this: I needed to calculate the total number of items in the nested arrays. I didn’t find a PHP function to help me with that but I came up with this idea:

Published
Categorized as PHP