Posted on

Get the Status of a Twitch Stream

I worked on a site for a friend some time ago and she is a streamer on Twitch. What I wanted to add is a widget in the header that shows her Twitch stream status, so when she is live, if someone goes to the site, they can see that, and eventually check her live Twitch stream.

Knowing if someone is live via the API that Twitch provides is very easy. Let’s check how I did that.

Continue reading Get the Status of a Twitch Stream

Posted on

Coding Day – Discord and Slack Post for WordPress

Most probably you don’t know, since I never announced it publicly here yet, but I started streaming video games and coding on my Twitch channel, at https://twitch.tv/gnabbo.

I stream every day, from 08:30pm GMT+2, and on Saturday and Sunday I also stream occasionally in the morning or afternoon.

I stream mainly video games during the week. On weekends instead, there’s an event named Coding Day, and that’s what I want to talk with you about!

Continue reading Coding Day – Discord and Slack Post for WordPress

Posted on

How to Create a Custom Bulk Action

WordPress 4.7 introduced a way to create your own custom bulk actions for your post types.

Before that, there were plugins to do it, but now that it’s in the core, it’s way easier to add a new bulk action, potentially you only need three functions!

Let’s see an example together about how to add a Move to Drafts bulk action, I know that is already possible if you bulk edit posts, but it involves many clicks, while with a bulk action is only a couple clicks!

Continue reading How to Create a Custom Bulk Action

Posted on

Pluck Fields Out Of an Object or Array

Some days ago I was working on a project and I needed to get out of an object some data, but not all of them. Specifically, I had many terms, and I needed to get only the key name from that object.

What I would have done, is looping though all the items and build an array from that with their names. But I learned about a better way!

Continue reading Pluck Fields Out Of an Object or Array