diff --git a/wp-includes/query.php b/wp-includes/query.php
index abc1111..def2222 100644
|
a
|
b
|
|
| 123 | 123 | */ |
| 124 | 124 | class WP_Query { |
| 125 | 125 | |
| | 126 | /** |
| | 127 | * Helper to check current query type against provided condition. |
| | 128 | * |
| | 129 | * @since 6.9.0 |
| | 130 | * |
| | 131 | * @param string $type Conditional type (e.g., 'home', 'single', 'page'). |
| | 132 | * @return bool True if current query matches type. |
| | 133 | */ |
| | 134 | private function is_query_type( $type ) { |
| | 135 | return ( ! empty( $this->$type ) && true === $this->$type ); |
| | 136 | } |
| | 137 | |
| | 138 | |
| | 139 | |
| 126 | 140 | /** |
| 127 | 141 | * Is the query for the blog homepage? |
| 128 | 142 | * |
| … |
… |
class WP_Query {
|
| 130 | 144 | * @return bool |
| 131 | 145 | */ |
| 132 | 146 | public function is_home() { |
| 133 | | return (bool) $this->is_home; |
| | 147 | return $this->is_query_type( 'is_home' ); |
| 134 | 148 | } |
| 135 | 149 | |
| 136 | 150 | /** |
| … |
… |
class WP_Query {
|
| 139 | 153 | * @return bool |
| 140 | 154 | */ |
| 141 | 155 | public function is_single() { |
| 142 | | return (bool) $this->is_single; |
| | 156 | return $this->is_query_type( 'is_single' ); |
| 143 | 157 | } |
| 144 | 158 | |
| 145 | 159 | /** |
| … |
… |
class WP_Query {
|
| 148 | 162 | * @return bool |
| 149 | 163 | */ |
| 150 | 164 | public function is_page() { |
| 151 | | return (bool) $this->is_page; |
| | 165 | return $this->is_query_type( 'is_page' ); |
| 152 | 166 | } |