Changeset 44960 for trunk/src/wp-includes/blocks/calendar.php
- Timestamp:
- 03/21/2019 12:46:11 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/calendar.php
r44810 r44960 14 14 */ 15 15 function render_block_core_calendar( $attributes ) { 16 global $monthnum, $year, $post; 16 global $monthnum, $year; 17 17 18 $previous_monthnum = $monthnum; 18 19 $previous_year = $year; 19 20 20 if ( isset( $attributes['month'] ) ) { 21 // phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited 22 $monthnum = $attributes['month']; 23 } 24 25 if ( isset( $attributes['year'] ) ) { 26 // phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited 27 $year = $attributes['year']; 21 if ( isset( $attributes['month'] ) && isset( $attributes['year'] ) ) { 22 $permalink_structure = get_option( 'permalink_structure' ); 23 if ( 24 strpos( $permalink_structure, '%monthnum%' ) !== false && 25 strpos( $permalink_structure, '%year%' ) !== false 26 ) { 27 // phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited 28 $monthnum = $attributes['month']; 29 // phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited 30 $year = $attributes['year']; 31 } 28 32 } 29 33
Note: See TracChangeset
for help on using the changeset viewer.