I'm working on a plugin, which converts a site into a feedback sort of portal. I made a new object page, 'Feedbacks', which displays all the feedbacks is a tabular format, and I'm using register_column_headers($array_of_column_headers) to make my table. I wanted to know if it is possible to add my own page row actions to this table, i mean under every feedback in the list, actions like 'approve', 'delete', 'blacklist' etc.

I read the code and a couple of tickets, and found out its done this way: for posts, its post_row_actions, for comments its comment_row_actions, for media its media_row_actions and so on. Is there a filter that allows me to do, my-page-slug_row_actions?


When using custom post type you use the post_row_actions filter hook and check the post type to modify it only:

add_filter('post_row_actions','my_action_row', 10, 2);

function my_action_row($actions, $post){
    //check for your post type
    if ($post->post_type =="feedbacks"){
        /*do you stuff here
        you can unset to remove actions
        and to add actions ex:
        $actions['in_google'] = '<a href="http://www.google.com/?q='.get_permalink($post->ID).'">check if indexed</a>';
    return $actions;

Quick update:

thanks to somatic if you custom post type is "hierarchical" then you action hook is: page_row_actions.

  • Does $post have scope? hint hint ;) – t31os Apr 18 '11 at 11:38
  • @t310s Fixed @Bainternet hope you don't mind ,) – kaiser Apr 18 '11 at 12:37
  • 2
    @kaiser: And improved your fix! – Jan Fabry Apr 18 '11 at 13:31
  • Hi, I already used 'post_row_actions' for adding a link in the the custom posts rows. But I want to do it for my menu page, which is added using 'add_object_page' hook (which is similar to 'add_menu_page'). add_object_page("Feedbacks", "Feedbacks", 10, "feedbacks-menu", "FeedbackMenuFunction"); add_submenu_page("feedbacks-menu", "Pending Feedbacks", "Pending", 10, "pending-feedbacks-menu", "PendingFeedbackMenuFunction") I was wondering if I could do, 'feedbacks-menu_row_actions(...)' (just like its done for other pages like 'Posts', 'Comments' etc using the page slug with row actions). – Rutwick Gangurde Apr 18 '11 at 15:31
  • 5
    for those of you banging your head on your desk wondering why this code seems to do nothing with your custom post type, note: if your CPT is "hierarchical", then your filter hook is "page_row_actions" and NOT "post_row_actions" [rubs head] – somatic May 5 '11 at 5:22

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.