Removing and renaming filters
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');
Here it is:
https://gist.github.com/rahularyan/5e6932f36cbbd2938de9
Rahul Aryan commented
Its completely wrong. Be careful, if you not familiar with coding.
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’);