PostTypes
PostTypes copied to clipboard
Compatability with attachment post type
hello allow me a quick question hiding e.g. the 'author' column for posts works just fine - was trying to use the same code for post type 'attachment' but couldn't get the author column to hide?
am I missing something here?
this is what I used:
$pt_attachment = new PostType( 'attachment' ); $pt_attachment->columns()->hide( 'author']);
Hi @mmjaeger
It seems that the attachment post type uses slightly different actions and filters for modifying the admin columns, which means I'll need to find out what the all are in order to fix it!
For now, if it's any use, the code below should do what you want until I get this fixed.
function remove_media_author_column( $cols ) {
unset($cols["author"]);
return $cols;
}
add_filter( 'manage_media_columns', 'remove_media_author_column' );
Thanks :)
thanks
On Fri, Jan 6, 2017 at 2:59 AM, Joe Grainger [email protected] wrote:
Hi @mmjaeger https://github.com/mmjaeger
It seems that the attachment post type uses slightly different actions and filters for modifying the admin columns, which means I'll need to find out what the all are in order to fix it!
For now, if it's any use, the code below should do what you want until I get this fixed.
function remove_media_author_column( $cols ) { unset($cols["author"]); return $cols;}add_filter( 'manage_media_columns', 'remove_media_author_column' );
Thanks :)
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jjgrainger/PostTypes/issues/5#issuecomment-270870302, or mute the thread https://github.com/notifications/unsubscribe-auth/ABe4lEp6Q6hKkjqJoekSAtGKnTE20PTrks5rPhCZgaJpZM4LU3dW .
-- Marco M. Jaeger http://net4visions.com
Consider this when implementing #9
Missed this when implementing #9 so I've updated the title to better describe the issue and work towards a fix
any update on supporting the 'attachment' post type??