Created
April 7, 2016 05:02
-
-
Save zarankumar/b79c32c6210362db7723ffdb16508129 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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