Removing and renaming filters

Solved4.28K viewsCorefilters
0

You recently posted the code how to remove the unsolved filter tab shown below. How would this be altered to remove the ‘active’ and ‘voted’ tabs?

Also how do I rename the tab labels as follows? – ‘Newest’ = ‘Latest’ , ‘Answers’ = ‘Answered’

/**
 * Filter for removing "unsolved" link from question list tab
 * @param  array $nav contain link of tab in array
 * @return array
 */
function my_remove_ap_tab_item($nav){
	unset($nav['unsolved'])
	return $nav;
}
add_filter('ap_questions_tab', 'my_remove_ap_tab_item');


0

Here it is:

https://gist.github.com/rahularyan/5e6932f36cbbd2938de9

What is wrong with my code?

function my_remove_ap_tab_item($nav){
unset($nav[‘unsolved’][‘active’][‘voted’]);
return $nav;
}
add_filter(‘ap_questions_tab’, ‘my_remove_ap_tab_item’);

function my_alter_ap_tab_item($nav){
$nav[‘newest’][‘answer’] = (‘latest’)(‘answered’);
return $nav;
}
add_filter(‘ap_questions_tab’, ‘my_alter_ap_tab_item’);

Its completely wrong. Be careful, if you not familiar with coding.

You are viewing 1 out of 1 answers, click here to view all answers.