Skip to content

Instantly share code, notes, and snippets.

@wgroenewold
Created November 14, 2016 09:29
Show Gist options
  • Save wgroenewold/1672bd6ac6559bbdc7489cc73e4acd93 to your computer and use it in GitHub Desktop.
Save wgroenewold/1672bd6ac6559bbdc7489cc73e4acd93 to your computer and use it in GitHub Desktop.
Filter the title for WP Nested Pages
add_filter('the_title', 'edit_np_title', 10, 3);
function edit_np_title($title, $id, $view = 'nestedpages_title'){
if(is_admin() && isset($_GET['page']) && $_GET['page'] == 'nestedpages-posttype'){
$prefix = 'prefix';
if($prefix){
$title = '[' . $prefix . '] ' . $title;
}
}
return $title;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment