Last active
August 29, 2015 14:00
-
-
Save trepmal/11011214 to your computer and use it in GitHub Desktop.
custom column with permalinks
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
<?php | |
// can save to path/to/wp/wp-content/mu-plugins/permalink-col.php | |
add_filter( 'manage_pages_columns', 'yourprefix_manage_pages_columns' ); | |
function yourprefix_manage_pages_columns( $posts_columns ) { | |
$posts_columns['permalink'] = 'Permalink'; | |
return $posts_columns; | |
} | |
add_action( 'manage_pages_custom_column', 'yourprefix_manage_pages_custom_column', 10, 2 ); | |
function yourprefix_manage_pages_custom_column( $column_name, $postID ) { | |
if ( 'permalink' == $column_name ) { | |
echo get_the_permalink( $postID ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment