Conversation
8f14b59 to
7a36e2a
Compare
| */ | ||
| protected function _url( $args, $callback ) { | ||
| foreach ( $args as $obj_id ) { | ||
| $object = $this->fetcher->get_check( $obj_id ); |
There was a problem hiding this comment.
The fetcher property didn't even exist on this abstract class, and in the extending classes it was private. So this code never worked. Plus it was never used, so it's safe to remove.
| $assoc_args['post_category'] = $this->get_category_ids( $assoc_args['post_category'] ); | ||
| } | ||
|
|
||
| if ( isset( $assoc_args['meta_input'] ) && Utils\wp_version_compare( '4.4', '<' ) ) { |
There was a problem hiding this comment.
Figured with our move to WP 4.9+ we can remove this compat code.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
|
||
| $items = wp_get_nav_menu_items( $args[0] ); | ||
| if ( false === $items || is_wp_error( $items ) ) { | ||
| if ( false === $items ) { |
There was a problem hiding this comment.
Is it impossible here to end up with a WP_Error? Relying on the docblocks is not enough, and I'm seeing that multiple filters are involved... 🤔
There was a problem hiding this comment.
There is no code path in there that returns WP_Error, I already checked.
Filters can always be abused, but we can‘t check for every possible return value.
git blame was unfortunately not helpful here (mangled history)
| if ( ! $menu || is_wp_error( $menu ) ) { | ||
| if ( false === $menu ) { |
There was a problem hiding this comment.
Same here re. WP_Error. I'm assuming there was a reason why that particular check was in there?
There was a problem hiding this comment.
I don't think so.
It was originally introduced in 246a8bc, but without any test coverage or so.
Like in the other cases, this function never returns a WP_Error
| list( $menu, $location ) = $args; | ||
|
|
||
| $menu = wp_get_nav_menu_object( $menu ); | ||
| if ( ! $menu || is_wp_error( $menu ) ) { |
Blocked by: