/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
add_filter( 'manage_posts_columns', 'namespace_AddXXXColumn' ); add_action( 'manage_posts_custom_column', 'namespace_AddXXXValue', 10, 2 ); function namespace_AddXXXColumn($cols) { $cols['xxx'] = __('XXX'); return $cols; } function namespace_AddXXXValue($column_name, $post_id) { if ( 'xxx' == $column_name ) { echo get_permalink($post_id); // for example } } // Register the column as sortable function xxx_column_register_sortable( $columns ) { $columns['xxx'] = 'xxx'; return $columns; } add_filter( 'manage_edit-post_sortable_columns', 'xxx_column_register_sortable' );