Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatability with attachment post type #5

Open
mmjaeger opened this issue Dec 23, 2016 · 5 comments
Open

Compatability with attachment post type #5

mmjaeger opened this issue Dec 23, 2016 · 5 comments

Comments

@mmjaeger
Copy link

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']);

@jjgrainger
Copy link
Owner

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 :)

@mmjaeger
Copy link
Author

mmjaeger commented Jan 6, 2017 via email

@jjgrainger
Copy link
Owner

Consider this when implementing #9

@jjgrainger
Copy link
Owner

Missed this when implementing #9 so I've updated the title to better describe the issue and work towards a fix

@jjgrainger jjgrainger changed the title remove column Compatability with attachment post type Oct 28, 2018
@mmjaeger
Copy link
Author

any update on supporting the 'attachment' post type??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants