Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

Martin Stehle on "Hooks for posts list columns also work in custom post types lists?"

$
0
0

I figured out an unexpectable behaviour of posts lists:

For printing out a posts list by /wp-admin/edit.php you can add new columns via the hooks 'manage_posts_columns' and 'manage_posts_custom_columns'.

Assume the post type is not 'post' but a custom post type, e.g. 'portfolio'. So you can print out a list of portfolio posts via /wp-admin/edit.php?post_type=portfolio.

I would expect that the formerly mentioned hooks do not work here, only the hooks for that custom post type 'manage_portfolio_posts_columns' and 'manage_portfolio_posts_custom_columns'.

But it seems that added functions via 'manage_posts_columns' and 'manage_posts_custom_columns' are also working in the portfoliio list.

Why that? And how to let functions only for the posts list no work in the portfolio list ?


Viewing all articles
Browse latest Browse all 8245

Trending Articles