Ticket #44005: 44005.diff
File 44005.diff, 2.5 KB (added by , 6 years ago) |
---|
-
src/wp-includes/class-wp-query.php
350 350 public $is_paged = false; 351 351 352 352 /** 353 * Signifies whether the current query is for the privacy policy page. 354 * 355 * @since 5.2 356 * @var bool 357 */ 358 public $is_privacy_policy = false; 359 360 /** 353 361 * Signifies whether the current query is for an administrative interface page. 354 362 * 355 363 * @since 1.5.0 … … 3949 3957 } 3950 3958 3951 3959 /** 3960 * Is the query for the privacy policy page? 3961 * 3962 * @since 5.2 3963 * 3964 * @return bool True, if is privacy policy page. 3965 */ 3966 public function is_privacy_policy() { 3967 $page_obj = $this->get_queried_object(); 3968 3969 if ( (int) get_option( 'wp_page_for_privacy_policy' ) === $page_obj->ID ) { 3970 return true; 3971 } else { 3972 return false; 3973 } 3974 } 3975 3976 /** 3952 3977 * Is the query for a post or page preview? 3953 3978 * 3954 3979 * @since 3.1.0 -
src/wp-includes/post-template.php
622 622 if ( is_404() ) { 623 623 $classes[] = 'error404'; 624 624 } 625 if ( is_privacy_policy() ) { 626 $classes[] = 'privacy-policy'; 627 } 625 628 626 629 if ( is_singular() ) { 627 630 $post_id = $wp_query->get_queried_object_id(); -
src/wp-includes/query.php
569 569 } 570 570 571 571 /** 572 * Determines whether the query is for the privacy policy page. 573 * 574 * For more information on this and similar theme functions, check out 575 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ 576 * Conditional Tags} article in the Theme Developer Handbook. 577 * 578 * @since 5.2 579 * 580 * @global WP_Query $wp_query Global WP_Query instance. 581 * 582 * @return bool 583 */ 584 function is_privacy_policy() { 585 global $wp_query; 586 587 if ( ! isset( $wp_query ) ) { 588 _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' ); 589 return false; 590 } 591 592 return $wp_query->is_privacy_policy(); 593 } 594 595 /** 572 596 * Determines whether the query is for a post or page preview. 573 597 * 574 598 * For more information on this and similar theme functions, check out