Skip to content

Instantly share code, notes, and snippets.

@zarankumar
Created April 7, 2016 05:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zarankumar/b79c32c6210362db7723ffdb16508129 to your computer and use it in GitHub Desktop.
Save zarankumar/b79c32c6210362db7723ffdb16508129 to your computer and use it in GitHub Desktop.
1. Change post title in post list column
add_action(
'admin_head-edit.php',
'wpse152971_edit_post_change_title_in_list'
);
function wpse152971_edit_post_change_title_in_list() {
add_filter(
'the_title',
'wpse152971_construct_new_title',
100,
2
);
}
function wpse152971_construct_new_title( $title, $id ) {
//print_r( $title );
//print_r( $id );
return 'new';
}
Making use of the admin_head-$hook_suffix hook.
2. Based on the manage_{$post_type}_posts_columns hook
add_filter(
'manage_post_posts_columns',
'wpse152971_replace_column_title_method_b'
);
function wpse152971_replace_column_title_method_b( $posts_columns ) {
//print_r($posts_columns);
$posts_columns[ 'title' ] = 'new title';
return $posts_columns;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment