post\\u row\\u actions,当我尝试打印时,此筛选器不会带来所有操作\\r
public function remove_quick_edit($actions) {
global $post;
echo "<pre>";
print_r($actions);
echo "</pre>";
$link_get = get_delete_post_link($post->ID);
if ( $post->post_type == \'cs_flags\' ) {
unset($actions[\'inline hide-if-no-js\']);
unset($actions[\'trash\']);
$actions[\'delete\'] = \'<span class="trash"><a class="submitdelete deletion" href="\' . get_delete_post_link($post->ID, \'\', true) . \'">\' . esc_html__(\'Delete\', \'jobhunt\') . \'</a></span>\';
}
return $actions;
}
它带来的结果是只有视图,它应该带来编辑和垃圾,但只有视图存在。
我正在调试为什么get\\u delete\\u post\\u链接不起作用,所以我发现这个问题可能是它们相互关联的。
http://prntscr.com/gxz0fu
自定义邮政类型代码
$args = array(
\'label\' => __( \'Flags\' ),
\'description\' => esc_html__( \'This is Description\' ),
\'public\' => true,
\'show_ui\' => true,
\'show_in_menu\' => \'edit.php?post_type=jobs\',
\'menu_position\' => true,
\'supports\' => array( \'title\' ),
\'exclude_from_search\' => true,
\'capabilities\' => array(
\'create_posts\' => false,
\'delete_posts\' => true
)
);
register_post_type( \'cs_flags\', $args );
}