post_row_actions filter is not working while update post using quick edit

admin2025-06-02  0

I have created two links using post_row_actions, it was displaying fine when page loads. But the links will get disappear after update post using quick-edit. Is it a bug from WordPress or did I miss something. My code will look like given below.

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

public function add_new_link($actions, $page_object)
{
    $actions['new_action'] = '<a href="'.admin_url().'post.php?id='.$page_object->ID.'&action=new-action">New Action</a>'; 
    return $actions;
}

Thank you

I have created two links using post_row_actions, it was displaying fine when page loads. But the links will get disappear after update post using quick-edit. Is it a bug from WordPress or did I miss something. My code will look like given below.

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

public function add_new_link($actions, $page_object)
{
    $actions['new_action'] = '<a href="'.admin_url().'post.php?id='.$page_object->ID.'&action=new-action">New Action</a>'; 
    return $actions;
}

Thank you

Share Improve this question edited Feb 26, 2014 at 4:30 Dipu R asked Feb 25, 2014 at 13:09 Dipu RDipu R 1415 bronze badges 1
  • As a sidenote: admin_url() takes two parameters: $path and $scheme. The first one would then be: admin_url("post.php?id={$page_object->ID}&action=new-action"); or add_query_arg( 'action', 'new-action', admin_url("post.php?id={$page_object->ID}") ); – kaiser Commented Feb 25, 2014 at 13:18
Add a comment  | 

1 Answer 1

Reset to default 1

Sorry for the question as I found out it is my mistake. It is happened because I disabled the admin object of my plugin while doing ajax(by mistake), it cause the issue of not processing "post_row_actions"(I defined in admin class) in quick-edit.

Thank you for your help.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748827626a314054.html

最新回复(0)