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

Posted on

Remove Additional CSS From the Customizer

WordPress 4.7 introduced a section in the Customizer called Additional CSS. This section should replace the Custom CSS option that many themes include in their Theme Options, or those plugins created for the same purpose.

Sometimes though, especially for developers, this could be a bad feature, because they don’t want their customers to edit CSS as they want.

How to remove the Additional CSS from the Customizer?

Continue reading Remove Additional CSS From the Customizer

Posted on

Show Products Short Description on Shop Page

Not much time ago I was searching on Google some stuff for WooCommerce, and I found a request from a user asking how to show the product short description on the shop page.

I don’t think it could be useful for all shops, but it could for some.

Here’s how you can do it.

Continue reading Show Products Short Description on Shop Page