Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit a497a2b

Browse files
authored
fix(tax): avoid error
1 parent 2027d66 commit a497a2b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

command.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ function codeat_get_by_url( $args ){
4646
$taxonomies = get_taxonomies( array( '_builtin' => true ), 'objects' );
4747
if ( is_array( $taxonomies ) ) {
4848
foreach ( $taxonomies as $taxonomy ) {
49+
if ( !is_array( $taxonomy->rewrite ) ) {
50+
continue;
51+
}
4952
if ( $taxonomy->rewrite[ 'slug' ] === $term_slug ) {
5053
$tax = get_term_by( 'slug', $last_slug, $taxonomy->name );
5154
if( is_object( $tax ) ) {

0 commit comments

Comments
 (0)