Customizing the “Enter title here” placeholder text

Today I’ve put a new item in my ideal category of “WordPress things I didn’t even know existed”, which is the ability to edit the “Enter title here” placeholder text when creating a new post or a new item in a Custom Post Type.

While there is no way of customizing such text at the moment of the creation of the Custom Post Type, there’s a neat filter that you can use to alter it, depending on the type of the post you’re creating.

It could go something like this:

add_filter( 'enter_title_here', function( $title, $post ) {
	if ( $post->post_type === 'your-post-type' ) {
		$title = __( 'Enter Company Name' );

	return $title;
}, 10, 2 );

Pretty easy, right? This is also a cool way of avoiding calling “Title” what in fact could be a “Company Name” or a “Testimonial Name”.

About WordCamp Torino 2016

Some say that a WordCamp isn’t really over until you blog about it.

So here I am, writing down a few thoughts about what has been an incredible event, WordCamp Torino 2016, the first official WordPress gathering in Italy in years.

First off, a big thank you to everyone involved in the organization of the event and the volunteers: you did an amazing job and everything went so great mainly because of your passion and commitment.

I’d also like to thank the speakers, who all delivered great presentations and I’m sure inspired not only me, but also the rest of the attendees.

Last but not least the sponsors, that made all of this possible.

For those of you who are unaware of the fact, the Italian WordPress community has been kind of lost and shattered for a good while. Even if the project was still maintained greatly and supported over the years by a very active and committed group of people, a complete sense of community was sort of missing.

Still, thanks to the wise choice of having a continent-wide WordCamp, many of us Italian WordPress enthusiasts managed to first met in Leiden, at WordCamp Europe 2014, then again in Sofia a year later, then again in Seville last June.

You know, the thing that strikes me the most about WordCamps is that by attending you not only receive invaluable new notions and tons of fresh inspiration and motivation, but you also get the opportunity of actively connecting with people all around the world.

That’s exactly what happened to us: over time, we didn’t only meet and discuss and contribute to the project, but we also became great friends, true friends and at the end of the day that’s one of the biggest reasons why everyone walked off with a big smile.

Give a group of friends the appropriate amount of time and an event like WordCamp Torino can happen and I’m sure that in the end it will be regarded of the first of many more.

I think two tweets sum it up way better that I’m equipped to do:

and lastly:

Oh yeah, I do too!

How to split a Gruntfile into multiple files

Task runners such as Grunt or Gulp can immensely speed up development, while also increasing the reliability of the code you’re writing.

The problem is that their configuration files tend to grow easily, even for small projects, and they can become hard to maintain pretty quickly.

The ones we’ve used back at my company so far follow the same path, so we though about finding a way to split them. Turns out, there is a way of doing so, and a quick search on Google returned more than one method to do it.

I’ve created a public Gist that summarizes what I’ve found.

Going in a little more detail about it, most notably here’s what I have discovered:

  • The load-grunt-tasks module allows you to automatically load the tasks you need, without having to call grunt.loadNpmTasks for each one of them; just add the tasks to the package.json file, and you’re good.
  • The loadConfig function (got the idea from Thomas Boyt) takes care of reading each configuration files that are put in a specific folder, such as tasks/options. Each file must be named as the task its declaring the configuration for (so uglify.js, for example). After reading each file, the only thing left to do is extending the main configuration object:
    grunt.util._.extend( config, loadConfig( "./tasks/options/" ) );
  • Grunt can already do the same for tasks definitions with the grunt.loadTasks( "tasks" ); instruction, which opens the tasks folder and looks for files containing tasks definitions.

So, in conclusion, just like I’m not looking back after having discovered what task runners can do for our projects, I doubt I’ll ever follow the single Gruntfile.js approach again.

WordCamp Torino 2016

For those of you that don’t know, Italy hasn’t had an official WordCamp for a few years in a row, with the last one being held in Bologna in early 2013.

In the past couple of years, the italian WordPress community has reorganized itself, with new local meetups being formed, led by reinvigorated polyglots and support teams, which now provide translations for themes, plugins, as well as WordPress core and apps, and help others over at the italian WordPress hub.


This breath of fresh air led to reorganizing events as well: on April 2nd Turin will host an official WordCamp, preceded with a Contributor Day the day before.

The importance of events like this cannot be overstated, and we hope this is going to be only the first in a long list of WordPress enthusiasts gatherings in our country.

At Evolve, we have decided to help the cause micro-sponsoring the event: it’s a small contribution, of course, but with lots of these great things can be accomplished.

And, hey, there are still tickets available: if you’re around, grab one, and come say hi!

I love finding hidden functions

My primary occupation is developing on WordPress and it’s pretty much a full time activity, so if you’re like me, getting your hands dirty in code, I’m sure this has happened to you at least once: finding a function you didn’t know about, that instantly simplifies an otherwise tedious or repetitive task.

It happened to me about two years ago, when I discovered the marvels of wp_list_pluck. If you’re wondering what it does: it grabs a particular property from a multi-dimensional array or an array of objects, and stacks the result of this computation in an array of its own. Pretty neat, definitely a nice time saver.

It has happened to me just today while I was taking care of some escaping in a theme we’re building. Escaping is quite possibly the single most important thing you can do in a theme beside design, certainly more than making it chock-full of features that will likely end up unused.

If you’re new to the subject and you’re not sold yet on the concept, I suggest you take a look at this video from Computerphile, and while you’re at it spend some more time on their channel, since it’s worth every second of it.

Anyway, the function I’ve discovered today is called wp_kses_post, and it automatically filters a string of text allowing only the HTML tags that are permitted in a post’s content.

Before that, when a simple esc_html wouldn’t do it, I used to spend a good minute writing the following (or a variation of it):

wp_kses( $string, array(
	'a' => array(
		'href' => array(),
		'title' => array()
	'br' => array(),
	'em' => array(),
	'strong' => array(),

which, long story short, is a more precise way of not allowing evil script tags where they shouldn’t be.

WordPress core has more to offer than you might know, so don’t be afraid to check it out and experiment with it, and also remember to always escape your output.

It’s ok not to know

To be honest I’ve never been much of a blogger, but over time an idea grew in my mind, unconsciously, that I didn’t have much to say either, that I didn’t have in me good enough ideas to contribute to the discussion, whatever topic the discussion might be about.

Which is plain wrong, as many would tell you. I know that now, yet I feel like struggling at the idea of publishing something that’s going to be read by strangers.

Yet, here I am, willing to make a step forward, and attempt to push something out of my mind in the wild making use of the tool I develop on pretty much every day, that is WordPress.

What the WordPress community has taught me in the last couple of years or so, is that anyone can add something, that anyone’s opinion counts, and that it’s the sum of the little and just apparently insignificant in the grand scheme of things contributions that actually makes the difference.

There’s a Jacob Riis quote that pretty much sums it up, much more eloquently that I’m able to do.

Look at a stone cutter hammering away at his rock, perhaps a hundred times without as much as a crack showing in it. Yet at the hundred-and-first blow it will split in two, and I know it was not the last blow that did it, but all that had gone before.

That is the very same quote that San Antonio Spurs’ coach Gregg Popovich has made sure it would be written on the walls of their training facility.

Today, someone in the WordPress Italian Community slack has linked to a video that put this concept back in the WordPress context, with the basic idea that it’s ok not to know, yet that shouldn’t stop anyone to have their say, to experiment, and to give their own contribution, albeit small.

Here it is!