Changeset 53429 for trunk/src/wp-includes/query.php
- Timestamp:
- 05/22/2022 03:15:47 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/query.php
r53395 r53429 940 940 function have_posts() { 941 941 global $wp_query; 942 943 if ( ! isset( $wp_query ) ) { 944 return false; 945 } 946 942 947 return $wp_query->have_posts(); 943 948 } … … 958 963 function in_the_loop() { 959 964 global $wp_query; 965 966 if ( ! isset( $wp_query ) ) { 967 return false; 968 } 969 960 970 return $wp_query->in_the_loop; 961 971 } … … 970 980 function rewind_posts() { 971 981 global $wp_query; 982 983 if ( ! isset( $wp_query ) ) { 984 return; 985 } 986 972 987 $wp_query->rewind_posts(); 973 988 } … … 982 997 function the_post() { 983 998 global $wp_query; 999 1000 if ( ! isset( $wp_query ) ) { 1001 return; 1002 } 1003 984 1004 $wp_query->the_post(); 985 1005 } … … 1000 1020 function have_comments() { 1001 1021 global $wp_query; 1022 1023 if ( ! isset( $wp_query ) ) { 1024 return false; 1025 } 1026 1002 1027 return $wp_query->have_comments(); 1003 1028 } … … 1009 1034 * 1010 1035 * @global WP_Query $wp_query WordPress Query object. 1011 *1012 * @return null1013 1036 */ 1014 1037 function the_comment() { 1015 1038 global $wp_query; 1016 return $wp_query->the_comment(); 1039 1040 if ( ! isset( $wp_query ) ) { 1041 return; 1042 } 1043 1044 $wp_query->the_comment(); 1017 1045 } 1018 1046
Note: See TracChangeset
for help on using the changeset viewer.