1

I am using the Content Scheduler plugin to control the post expire. The plugin will add a expiry date column on the wp-admin/edit.php in page and post. However it doesn't show in custom post type page list.

So I take a look into plugin codes and found this which believe are the one that control the column in the page list.

add_action ( 'manage_posts_custom_column', array( $this, 'cs_show_expdate' ) );
add_filter ('manage_posts_columns', array( $this, 'cs_add_expdate_column' ) );

Thus, I tried to add another filter for the custom post type in the plugin file, like these:

add_action ( 'manage_cpt_posts_custom_column', array( $this, 'cs_show_expdate' ));
add_filter ('manage_cpt_posts_columns', array( $this, 'cs_add_expdate_column' ) );

where cpt is the custom post type, however this won't work, any idea why?

By the way, I know it is not a good approach to alter the plugin core codes, but I don't know if I can hook it in functions.php. Anyone know how to do this? thanks.

2

the correct hooks are manage_{$post_type}_posts_custom_column action hook to display the column and manage_edit-{$post_type}_columns filter hook to add the column, so try,

add_action ( 'manage_cpt_posts_custom_column', array( $this, 'cs_show_expdate' ));
add_filter ('manage_edit-cpt_columns', array( $this, 'cs_add_expdate_column' ) );
  • No luck, still doesn't work. – dev-jim May 2 '12 at 10:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.