Merge pull request #248 from kadimi/patch-7
Validate `sportspress_term_order()` parameter `$terms`
This commit is contained in:
@@ -141,6 +141,10 @@ function sportspress_strcmp_term_slug( $a, $b ) {
|
|||||||
|
|
||||||
function sportspress_term_order( $terms, $post_id, $taxonomy ) {
|
function sportspress_term_order( $terms, $post_id, $taxonomy ) {
|
||||||
|
|
||||||
|
if ( ! is_array( $terms ) ) {
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
if ( is_sp_taxonomy( $taxonomy ) ) {
|
if ( is_sp_taxonomy( $taxonomy ) ) {
|
||||||
uasort( $terms, 'sportspress_strcmp_term_slug' );
|
uasort( $terms, 'sportspress_strcmp_term_slug' );
|
||||||
}
|
}
|
||||||
@@ -309,4 +313,4 @@ function sportspress_remove_page_parent_class( $classes, $item ) {
|
|||||||
return $classes;
|
return $classes;
|
||||||
}
|
}
|
||||||
|
|
||||||
add_filter( 'nav_menu_css_class', 'sportspress_remove_page_parent_class', 10, 2 );
|
add_filter( 'nav_menu_css_class', 'sportspress_remove_page_parent_class', 10, 2 );
|
||||||
|
|||||||
Reference in New Issue
Block a user