[wp-trac] [WordPress Trac] #26974: WP confuses post permalink and day permalink when using /%year%/%monthnum%/%postname%/

WordPress Trac noreply at wordpress.org
Fri Jan 31 15:39:23 UTC 2014


#26974: WP confuses post permalink and day permalink when using
/%year%/%monthnum%/%postname%/
-------------------------------+-----------------------------
 Reporter:  Denis-de-Bernardy  |      Owner:
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  Permalinks         |    Version:  trunk
 Severity:  normal             |   Keywords:
  Focuses:                     |
-------------------------------+-----------------------------
 To reproduce, create a new blog, select that permalink structure, and
 publish an untitled post. View it. Expected: the post shows up. Actual:
 the day shows up empty — unless, of course, the post's day matches the
 post's id.

 Minor, but annoying. Temporary fix to disable day links entirely:

 {{{
 add_filter('date_rewrite_rules', function($date_rewrite_rules) {
         if (get_option('permalink_structure') ==
 '/%year%/%monthnum%/%postname%/') {
                 $date_rewrite_rules = array_filter($date_rewrite_rules,
 function($rule) {
                         return strpos($rule, '&day=') === false;
                 });
         }
         return $date_rewrite_rules;
 });
 }}}

 Methinks disabling day links should be the default behavior in WP when
 that structure is chosen.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/26974>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list