Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Remove the extra 'Quiz' on the single quiz page
add_filter( 'sensei_single_title', 'sensei_dl_custom_double_quiz_remove' );
function sensei_dl_custom_double_quiz_remove( $title ){
if( 'quiz' == get_post_type()
&& 1 < substr_count( strtoupper( $title ), 'QUIZ' ) ){
// remove all possible appearances of quiz
$title_with_no_quizzes = str_replace( 'quiz', '', $title );
$title_with_no_quizzes = str_replace( 'Quiz', '', $title_with_no_quizzes );
$title_with_no_quizzes = str_replace( 'Quiz', '', $title_with_no_quizzes );
return $title_with_no_quizzes . __( 'Quiz', 'woothemes-sensei');
}
return $title;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.