-
Notifications
You must be signed in to change notification settings - Fork 216
fix: allow to use this theme an old php version #737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -641,7 +641,7 @@ protected function add_term_archive_items() { | |
| if ( false !== $taxonomy->rewrite ) { | ||
|
|
||
| // If 'with_front' is true, dd $wp_rewrite->front to the trail. | ||
| if ( $taxonomy->rewrite['with_front'] && $wp_rewrite->front ) | ||
| if ( array_key_exists('with_front', $taxonomy->rewrite) && $taxonomy->rewrite['with_front'] && $wp_rewrite->front ) | ||
| $this->add_rewrite_front_items(); | ||
|
|
||
| // Get parent pages by path if they exist. | ||
|
|
@@ -1112,7 +1112,7 @@ protected function get_post_types_by_slug( $slug ) { | |
|
|
||
| foreach ( $post_types as $type ) { | ||
|
|
||
| if ( $slug === $type->has_archive || ( true === $type->has_archive && $slug === $type->rewrite['slug'] ) ) | ||
| if ( $slug === $type->has_archive || ( true === $type->has_archive && is_array($type->rewrite) && isset($type->rewrite['slug']) && $slug === $type->rewrite['slug'])) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Non è un'eventualità piuttosto remota? |
||
| $return[] = $type; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Se deve essere controllata l'esistenza, perché non semplicemente
! empty()?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ci potrebbero essere dei casi in cui with_font non era valorizzata, ecco perche questo check in più
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sì; intendevo che
! empty($taxonomy->rewrite['with_front'])ha lo stesso effetto ed è più leggibile e conciso.