对不起,我的英语不好<其次,两周以来我一直找不到解决问题的方法。这件事很简单,但我找不到怎么做
我解释我的问题:
我在函数“my\\u custom\\u init”中调用了2个自定义分类法:
register_taxonomy( \'directors\', \'video\', array( \'hierarchical\' => true, \'label\' => \'Directors\', \'query_var\' => true, \'rewrite\' => true ) );
register_taxonomy( \'clients\', \'video\', array( \'hierarchical\' => true, \'label\' => \'Clients\', \'query_var\' => true, \'rewrite\' => true ) );
我想编辑打印屏幕上的“视图”链接:
http://nsa32.casimages.com/img/2012/10/18/121018025542594841.png我想我必须使用post\\u row\\u操作来编辑它,但我无法获得分类<如果您知道如何解决我的问题,请提前感谢您的帮助。
Edit
我为我的分类“帖子”和“视频”制作了这个,它很管用!但是我不能对我的自定义分类法做同样的事情://br>我真的不明白我尝试了但没有成功:S
add_filter( \'post_row_actions\', \'remove_row_actions\', 10, 1);
function remove_row_actions( $actions )
{
if( get_post_type() === \'post\' )
unset( $actions[\'view\'] );
if( get_post_type() === \'page\' )
unset( $actions[\'view\'] ); //doesn\'t work ?
if( get_post_type() === \'video\' )
unset( $actions[\'view\'] );
// Adding a custom link and passing the post id with it
$permalink = get_permalink();
$permalink = explode(".tv", $permalink);
$actions[\'customedit\'] = "<a href=\\"/#$permalink[1]\\" target=\\"blank\\">View & Get Url</a>";
return $actions;
}
SO网友:Ramon Fincken
/**
* Generates and displays row action links.
*
* @since 4.3.0
*
* @param WP_Term $tag Tag being acted upon.
* @param string $column_name Current column name.
* @param string $primary Primary column name.
* @return string Row actions output for terms.
*/
protected function handle_row_actions( $tag, $column_name, $primary ) {
提供2个整洁的过滤器:
/**
* Filters the action links displayed for each term in the Tags list table.
*
* @since 2.8.0
* @deprecated 3.0.0 Use {$taxonomy}_row_actions instead.
*
* @param string[] $actions An array of action links to be displayed. Default
* \'Edit\', \'Quick Edit\', \'Delete\', and \'View\'.
* @param WP_Term $tag Term object.
*/
$actions = apply_filters( \'tag_row_actions\', $actions, $tag );
/**
* Filters the action links displayed for each term in the terms list table.
*
* The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
*
* @since 3.0.0
*
* @param string[] $actions An array of action links to be displayed. Default
* \'Edit\', \'Quick Edit\', \'Delete\', and \'View\'.
* @param WP_Term $tag Term object.
*/
$actions = apply_filters( "{$taxonomy}_row_actions", $actions, $tag );
return $this->row_actions( $actions );