rebase on oct-10-2023
This commit is contained in:
@@ -149,7 +149,8 @@ function get_category_by_path( $category_path, $full_match = true, $output = OBJ
|
||||
foreach ( $categories as $category ) {
|
||||
$path = '/' . $leaf_path;
|
||||
$curcategory = $category;
|
||||
while ( ( 0 != $curcategory->parent ) && ( $curcategory->parent != $curcategory->term_id ) ) {
|
||||
|
||||
while ( ( 0 !== $curcategory->parent ) && ( $curcategory->parent !== $curcategory->term_id ) ) {
|
||||
$curcategory = get_term( $curcategory->parent, 'category' );
|
||||
|
||||
if ( is_wp_error( $curcategory ) ) {
|
||||
@@ -159,7 +160,7 @@ function get_category_by_path( $category_path, $full_match = true, $output = OBJ
|
||||
$path = '/' . $curcategory->slug . $path;
|
||||
}
|
||||
|
||||
if ( $path == $full_path ) {
|
||||
if ( $path === $full_path ) {
|
||||
$category = get_term( $category->term_id, 'category', $output );
|
||||
_make_cat_compat( $category );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user