最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Remove the "View" Link in Post Admin

programmeradmin1浏览0评论

I have a custom post type that I'm just using just to keep data in but I sometimes share it with others, and I don't want any confusion when the "view" link appears in the admin column.

Is there a way of removing that?

.jpg .jpg

I have a custom post type that I'm just using just to keep data in but I sometimes share it with others, and I don't want any confusion when the "view" link appears in the admin column.

Is there a way of removing that?

http://img.skitch/20110421-des28mtj4br3aeyfxnypnkghsy.jpg http://img.skitch/20110421-des28mtj4br3aeyfxnypnkghsy.jpg

Share Improve this question edited Apr 21, 2011 at 15:01 Chris_O 20.6k5 gold badges62 silver badges96 bronze badges asked Apr 21, 2011 at 14:25 MarcoMarco 2091 gold badge5 silver badges13 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 24
add_filter( 'post_row_actions', 'remove_row_actions', 10, 1 );

function remove_row_actions( $actions )
{
    if( get_post_type() === 'my_cpt' )
        unset( $actions['view'] );
    return $actions;
}

Should see you through :)

The $actions array consists of the following:

$actions['edit'] 
$actions['inline hide-if-no-js'] 
$actions['trash'] 
$actions['view'] 

To modify users grid view 'user_row_actions' filter can be used.

For future reference.

Is there a way to remove the "View" link under the users in the backend User panel? All users are listed with an Edit, Delete, View link. I'm looking to remove that View link. Much appreciated.

发布评论

评论列表(0)

  1. 暂无评论