Skip to content

Instantly share code, notes, and snippets.

@jesgs
Created October 7, 2013 17:35
Show Gist options
  • Select an option

  • Save jesgs/6871789 to your computer and use it in GitHub Desktop.

Select an option

Save jesgs/6871789 to your computer and use it in GitHub Desktop.
The author was lazy today...
<?php
add_filter('the_title', '_correct_empty_title', 10, 2);
/**
* Add snarky filler title for posts without titles
*
* @param string $title WordPress post title
* @param int $id WordPress post ID
* @return string
*/
function _correct_empty_title($title, $id)
{
if ($title === '') {
$title = __('No Title; Author Too Lazy &hellip;');
}
return $title;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment