PostTypes icon indicating copy to clipboard operation
PostTypes copied to clipboard

Compatability with attachment post type

Open mmjaeger opened this issue 8 years ago • 5 comments

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

mmjaeger avatar Dec 23 '16 14:12 mmjaeger

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

jjgrainger avatar Jan 06 '17 09:01 jjgrainger

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

mmjaeger avatar Jan 06 '17 14:01 mmjaeger

Consider this when implementing #9

jjgrainger avatar Aug 02 '17 11:08 jjgrainger

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

jjgrainger avatar Oct 28 '18 14:10 jjgrainger

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

mmjaeger avatar May 30 '22 23:05 mmjaeger