diff --git src/wp-includes/rewrite.php src/wp-includes/rewrite.php
index 984fbbe..5d2d439 100644
|
|
class WP_Rewrite { |
895 | 895 | * one is used. If none matches, then the default will be used, which is |
896 | 896 | * year, month, day. |
897 | 897 | * |
898 | | * Prevents post ID and date permalinks from overlapping. In the case of |
899 | | * post_id, the date permalink will be prepended with front permalink with |
900 | | * 'date/' before the actual permalink to form the complete date permalink |
901 | | * structure. |
| 898 | * Prevents post ID or slug and date permalinks from overlapping. In the case of |
| 899 | * post_id or a postname only structure, the date permalink will be prepended |
| 900 | * with front permalink and 'date/' before the actual permalink to form the |
| 901 | * complete date permalink structure. |
902 | 902 | * |
903 | 903 | * @since 1.5.0 |
904 | 904 | * @access public |
… |
… |
class WP_Rewrite { |
930 | 930 | if ( empty($date_endian) ) |
931 | 931 | $date_endian = '%year%/%monthnum%/%day%'; |
932 | 932 | |
933 | | // Do not allow the date tags and %post_id% to overlap in the permalink |
934 | | // structure. If they do, move the date tags to $front/date/. |
| 933 | /* |
| 934 | * Do not allow the date tags and %post_id% or %postname% to overlap in the |
| 935 | * permalink structure. If they do, move the date tags to $front/date/. |
| 936 | */ |
935 | 937 | $front = $this->front; |
936 | 938 | preg_match_all('/%.+?%/', $this->permalink_structure, $tokens); |
937 | 939 | $tok_index = 1; |
938 | 940 | foreach ( (array) $tokens[0] as $token) { |
939 | | if ( '%post_id%' == $token && ($tok_index <= 3) ) { |
| 941 | if ( ( '%post_id%' == $token && $tok_index <= 3 ) || ( '%postname%' == $token && $tok_index == 1 ) ) { |
940 | 942 | $front = $front . 'date/'; |
941 | 943 | break; |
942 | 944 | } |