我同意你的看法,当你在更新一个术语后被重定向时,这有点出乎意料。
此外,表单本身似乎没有错误处理,如果您试图犯一些错误,例如删除术语名称和slug,它不会显示任何错误,只需忽略您的更改并重定向即可。
更新后,您可以尝试以下操作以保持在同一编辑术语页面上:
/**
 * Stay on the edit term page after updating.
 * @see http://wordpress.stackexchange.com/a/168206/26350
 */
add_filter( \'wp_redirect\', 
    function( $location ){
        $mytaxonomy = \'post_tag\'; # <-- Edit this to your needs!
        $args = array(
            \'action\'   => FILTER_SANITIZE_STRING,
            \'taxonomy\' => FILTER_SANITIZE_STRING,
            \'tag_ID\'   => FILTER_SANITIZE_NUMBER_INT,
        );
        $_inputs    = filter_input_array( INPUT_POST, $args );
        $_post_type = filter_input( INPUT_GET, \'post_type\', FILTER_SANITIZE_STRING );
        if( \'editedtag\' === $_inputs[\'action\'] 
            && $mytaxonomy === $_inputs[\'taxonomy\']
            && $_inputs[\'tag_ID\'] > 0
        ){
            $location = add_query_arg( \'action\',   \'edit\',               $location );
            $location = add_query_arg( \'taxonomy\', $_inputs[\'taxonomy\'], $location );
            $location = add_query_arg( \'tag_ID\',   $_inputs[\'tag_ID\'],   $location );
            if( $_post_type )
                $location = add_query_arg( \'post_type\', $_post_type, $location );
        }
        return $location;
    }
);
 您必须修改
$mytaxonomy 满足您的需求。
您可能还想向表单添加一个返回链接,例如:
/**
 * Add a "Go back" link to the post tag edit form.
 * @see http://wordpress.stackexchange.com/a/168206/26350
 */
add_action( \'post_tag_edit_form\',
    function( $tag ) {
        $url = admin_url( \'edit-tags.php\' );
        $url = add_query_arg( \'tag_ID\',   $tag->term_id, $url );
        $url = add_query_arg( \'taxonomy\', $tag->taxonomy, $url );
        printf( \'<a href="%s">%s</a>\', $url, __( \'Go back\' ) );
    }
);
 我们使用
{$taxonomy}_edit_form 钩将链接直接添加到submit按钮下方,或者在同一行中,而不是像我们在这里所做的那样添加到上面,可能更有意义,但我找不到任何合适的挂钩。当然,您可以使用CSS来更改链接的位置。