DEV Community

Cover image for WordPress: Custom link in taxonomy row actions
Alexey
Alexey

Posted on

WordPress: Custom link in taxonomy row actions

add_action( 'category_row_actions',  'zl_actions_rows' , 10 ,2 );
public function 'zl_actions_rows' ( $actions, $category ) {
    $new_actions                         = array();
    $new_actions['edit']                 = $actions['edit'];
    $new_actions['template']             = '<a href="#" aria-label="' . __( 'Custom Link', 'zl') . '">' . __( 'Custom Link', 'zl') . '</a>';
    $new_actions['view']                 = $actions['view'];
    $new_actions['inline hide-if-no-js'] = $actions['inline hide-if-no-js'];

    return $new_actions;
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)