Add Page ID in Pages List
-
While I am successfull at posting the POST ID column in my Post list, I cannot seem to figure out why the Page ID won’t display. I believe I’m using the correct variable:
add_filter( 'manage_posts_columns', 'revealid_add_id_column', 5 ); add_action( 'manage_posts_custom_column', 'revealid_id_column_content', 5, 2 ); add_filter( 'manage_pages_columns', 'revealid_add_id_column', 5 ); add_action( 'manage_pages_custom_column', 'revealid_id_column_content', 5, 2 ); function revealid_add_id_column( $columns ) { $checkbox = array_slice( $columns , 0, 1 ); $columns = array_slice( $columns , 1 ); $id['revealid_id'] = 'ID'; $columns = array_merge( $checkbox, $id, $columns ); return $columns; } function revealid_id_column_content( $column, $id ) { if( 'revealid_id' == $column ) { echo $id; } } $custom_post_types = get_post_types( array( 'public' => true, '_builtin' => false ), 'names' ); foreach ( $custom_post_types as $post_type ) { add_action( 'manage_edit-'. $post_type . '_columns', 'revealid_add_id_column' ); add_filter( 'manage_'. $post_type . '_custom_column', 'revealid_id_column_content' ); }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Add Page ID in Pages List’ is closed to new replies.