$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>post_row_actions filter is not working while update post using quick edit|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

post_row_actions filter is not working while update post using quick edit

matteradmin10PV0评论

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.

Post a comment

comment list (0)

  1. No comments so far