Changeset 51154 for trunk/src/wp-includes/query.php
- Timestamp:
- 06/15/2021 03:21:50 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/query.php
r49927 r51154 900 900 */ 901 901 function is_main_query() { 902 global $wp_query; 903 902 904 if ( 'pre_get_posts' === current_filter() ) { 903 $message = sprintf( 904 /* translators: 1: pre_get_posts, 2: WP_Query->is_main_query(), 3: is_main_query(), 4: Documentation URL. */ 905 __( 'In %1$s, use the %2$s method, not the %3$s function. See %4$s.' ), 906 '<code>pre_get_posts</code>', 907 '<code>WP_Query->is_main_query()</code>', 908 '<code>is_main_query()</code>', 909 __( 'https://developer.wordpress.org/reference/functions/is_main_query/' ) 905 _doing_it_wrong( 906 __FUNCTION__, 907 sprintf( 908 /* translators: 1: pre_get_posts, 2: WP_Query->is_main_query(), 3: is_main_query(), 4: Documentation URL. */ 909 __( 'In %1$s, use the %2$s method, not the %3$s function. See %4$s.' ), 910 '<code>pre_get_posts</code>', 911 '<code>WP_Query->is_main_query()</code>', 912 '<code>is_main_query()</code>', 913 __( 'https://developer.wordpress.org/reference/functions/is_main_query/' ) 914 ), 915 '3.7.0' 910 916 ); 911 _doing_it_wrong( __FUNCTION__, $message, '3.7.0' ); 912 } 913 914 global $wp_query; 917 } 918 915 919 return $wp_query->is_main_query(); 916 920 }
Note: See TracChangeset
for help on using the changeset viewer.