Changeset 59939 for trunk/src/wp-includes/general-template.php
- Timestamp:
- 03/05/2025 10:36:38 PM (15 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/general-template.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/general-template.php
r59909 r59939 2293 2293 $args = apply_filters( 'get_calendar_args', wp_parse_args( $args, $defaults ) ); 2294 2294 2295 $key = md5( $m . $monthnum . $year ); 2295 if ( ! post_type_exists( $args['post_type'] ) ) { 2296 $args['post_type'] = 'post'; 2297 } 2298 2299 $w = 0; 2300 if ( isset( $_GET['w'] ) ) { 2301 $w = (int) $_GET['w']; 2302 } 2303 2304 /* 2305 * Normalize the cache key. 2306 * 2307 * The following ensures the same cache key is used for the same parameter 2308 * and parameter equivalents. This prevents `post_type > post, initial > true` 2309 * from generating a different key from the same values in the reverse order. 2310 * 2311 * `display` is excluded from the cache key as the cache contains the same 2312 * HTML regardless of this functions need to echo or return the output. 2313 * 2314 * The global values contain data generated by the URL querystring variables. 2315 */ 2316 $cache_args = $args; 2317 unset( $cache_args['display'] ); 2318 2319 $cache_args['globals'] = array( 2320 'm' => $m, 2321 'monthnum' => $monthnum, 2322 'year' => $year, 2323 'week' => $w, 2324 ); 2325 2326 wp_recursive_ksort( $cache_args ); 2327 $key = md5( serialize( $cache_args ) ); 2296 2328 $cache = wp_cache_get( 'get_calendar', 'calendar' ); 2297 2329 … … 2313 2345 2314 2346 $post_type = $args['post_type']; 2315 if ( ! post_type_exists( $post_type ) ) {2316 $post_type = 'post';2317 }2318 2347 2319 2348 // Quick check. If we have no posts at all, abort! … … 2328 2357 } 2329 2358 2330 if ( isset( $_GET['w'] ) ) {2331 $w = (int) $_GET['w'];2332 }2333 2359 // week_begins = 0 stands for Sunday. 2334 2360 $week_begins = (int) get_option( 'start_of_week' );
Note: See TracChangeset
for help on using the changeset viewer.