Changeset 35848 for trunk/src/wp-includes/query.php
- Timestamp:
- 12/10/2015 03:05:34 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/query.php
r35690 r35848 295 295 296 296 return $wp_query->is_tax( $taxonomy, $term ); 297 }298 299 /**300 * Whether the current URL is within the comments popup window.301 *302 * @since 1.5.0303 *304 * @global WP_Query $wp_query Global WP_Query instance.305 *306 * @return bool307 */308 function is_comments_popup() {309 global $wp_query;310 311 if ( ! isset( $wp_query ) ) {312 _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );313 return false;314 }315 316 return $wp_query->is_comments_popup();317 297 } 318 298 … … 863 843 * 864 844 * @since 1.5.0 845 * @since 4.5.0 Removed the `$comments_popup` property. 865 846 */ 866 847 class WP_Query { … … 1229 1210 */ 1230 1211 public $is_embed = false; 1231 1232 /**1233 * Set if query is within comments popup window.1234 *1235 * @since 1.5.01236 * @access public1237 * @var bool1238 */1239 public $is_comments_popup = false;1240 1212 1241 1213 /** … … 1390 1362 $this->is_home = false; 1391 1363 $this->is_404 = false; 1392 $this->is_comments_popup = false;1393 1364 $this->is_paged = false; 1394 1365 $this->is_admin = false; … … 1442 1413 * 1443 1414 * @since 2.1.0 1415 * @since 4.4.0 Removed the `comments_popup` public query variable. 1444 1416 * @access public 1445 1417 * … … 1477 1449 , 'tb' 1478 1450 , 'paged' 1479 , 'comments_popup'1480 1451 , 'meta_key' 1481 1452 , 'meta_value' … … 1512 1483 * @since 4.4.0 Introduced `$post_name__in` and `$title` parameters. `$s` was updated to support excluded 1513 1484 * search terms, by prepending a hyphen. 1485 * @since 4.5.0 Removed the `$comments_popup` parameter. 1514 1486 * @access public 1515 1487 * … … 1530 1502 * @type int $comments_per_page The number of comments to return per page. 1531 1503 * Default 'comments_per_page' option. 1532 * @type int|string $comments_popup Whether the query is within the comments popup. Default empty.1533 1504 * @type array $date_query An associative array of WP_Date_Query arguments. 1534 1505 * {@see WP_Date_Query::__construct()} … … 1792 1763 $this->is_paged = true; 1793 1764 1794 if ( '' != $qv['comments_popup'] )1795 $this->is_comments_popup = true;1796 1797 1765 // if we're previewing inside the write screen 1798 1766 if ( '' != $qv['preview'] ) … … 1812 1780 $this->is_comment_feed = true; 1813 1781 1814 if ( !( $this->is_singular || $this->is_archive || $this->is_search || $this->is_feed || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) || $this->is_trackback || $this->is_404 || $this->is_admin || $this->is_ comments_popup || $this->is_robots ) )1782 if ( !( $this->is_singular || $this->is_archive || $this->is_search || $this->is_feed || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) || $this->is_trackback || $this->is_404 || $this->is_admin || $this->is_robots ) ) 1815 1783 $this->is_home = true; 1816 1784 … … 2772 2740 } 2773 2741 2774 if ( intval($q['comments_popup']) )2775 $q['p'] = absint($q['comments_popup']);2776 2777 2742 // If an attachment is requested by number, let it supersede any post number. 2778 2743 if ( $q['attachment_id'] ) … … 4385 4350 * 4386 4351 * @since 3.1.0 4352 * @deprecated 4.5.0 4387 4353 * 4388 4354 * @return bool 4389 4355 */ 4390 4356 public function is_comments_popup() { 4391 return (bool) $this->is_comments_popup; 4357 _deprecated_function( __FUNCTION__, '4.5' ); 4358 4359 return false; 4392 4360 } 4393 4361
Note: See TracChangeset
for help on using the changeset viewer.