| @@ -59,9 +59,9 @@ | ||
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /** |
| 63 | - * Adds the "Parse.ly Stats" button on the admin bar when the current object | |
| 63 | + * Adds the `Parse.ly Stats` button on the admin bar when the current object | |
| 64 | 64 | * is a post or a page. |
| 65 | 65 | * |
| 66 | 66 | * @param WP_Admin_Bar $admin_bar WP_Admin_Bar instance, passed by reference. |
| 67 | 67 | */ |
| @@ -66,18 +66,15 @@ | ||
| 66 | 66 | * @param WP_Admin_Bar $admin_bar WP_Admin_Bar instance, passed by reference. |
| 67 | 67 | */ |
| 68 | 68 | public function admin_bar_parsely_stats_button( WP_Admin_Bar $admin_bar ): void { |
| 69 | 69 | /** |
| 70 | - * The result of calling get_queried_object(). | |
| 70 | + * Variable. | |
| 71 | 71 | * |
| 72 | - * Although it shouldn't return false per the documentation, it can | |
| 73 | - * happen in practice. | |
| 74 | - * | |
| 75 | - * @var \WP_Term|\WP_Post_Type|WP_Post|\WP_User|null|false | |
| 72 | + * @var \WP_Term|\WP_Post_Type|WP_Post|\WP_User|null | |
| 76 | 73 | */ |
| 77 | 74 | $queried_object = $GLOBALS['wp_the_query']->get_queried_object(); |
| 78 | 75 | |
| 79 | - if ( ! $queried_object instanceof WP_Post ) { | |
| 76 | + if ( null === $queried_object || WP_Post::class !== get_class( $queried_object ) ) { | |
| 80 | 77 | return; |
| 81 | 78 | } |
| 82 | 79 | |
| 83 | 80 | /** |