WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #35916


Ignore:
Timestamp:
02/27/2016 02:35:19 AM (6 years ago)
Author:
johnbillion
Comment:

Thanks for the report, @solo14000, and welcome to WordPress Trac.

I've confirmed this bug. Rewrite rules for endpoints and feeds still get generated for the permalink structure in this situation.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #35916

    • Property Keywords needs-patch needs-unit-tests added
    • Property Version changed from 4.4.2 to
    • Property Component changed from Permalinks to Rewrite Rules
  • Ticket #35916 – Description

    initial v1  
    99
    1010{{{#!php
    11 <?php
    1211array( // Array of WP post type args
    13 'labels' => array( 'name' => 'Events',
    14 'singular_name' => 'Event',
    15 ),
    16 'public' => true,
    17 'publicly_queryable' => true,
    18 'show_ui' => true,
    19 'show_in_menu' => true,
    20 'query_var' => false,
    21 'rewrite' => false,
    22 'capability_type' => 'post',
    23 'hierarchical' => false,
    24 'menu_position' => 5,
    25 'menu_icon' => 'dashicons-tickets-alt',
    26 'supports' => array(
    27 'title',
    28 'editor',
    29 'thumbnail',
    30 ),
    31 'taxonomies' => array(
    32 'post_tag',
    33 'my_category',
    34 ),
     12        'labels' => array(
     13                'name' => 'Events',
     14                'singular_name' => 'Event',
     15        ),
     16        'public' => true,
     17        'publicly_queryable' => true,
     18        'show_ui' => true,
     19        'show_in_menu' => true,
     20        'query_var' => false,
     21        'rewrite' => false,
     22        'capability_type' => 'post',
     23        'hierarchical' => false,
     24        'menu_position' => 5,
     25        'menu_icon' => 'dashicons-tickets-alt',
     26        'supports' => array(
     27                'title',
     28                'editor',
     29                'thumbnail',
     30        ),
     31        'taxonomies' => array(
     32                'post_tag',
     33                'my_category',
     34        ),
    3535);
    3636}}}
     
    3939
    4040{{{#!php
    41 <?php
    4241$args_post_type = array(
    4342        'feed'          => false,
     
    5251
    5352{{{
    54   'events/[^/]+/attachment/([^/]+)/?$' => string 'index.php?attachment=$matches[1]' (length=32)
    55   'events/[^/]+/attachment/([^/]+)/trackback/?$' => string 'index.php?attachment=$matches[1]&tb=1' (length=37)
    56   'events/[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?attachment=$matches[1]&feed=$matches[2]' (length=49)
    57   'events/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?attachment=$matches[1]&feed=$matches[2]' (length=49)
    58   'events/[^/]+/attachment/([^/]+)/comment-page-([0-9]{1,})/?$' => string 'index.php?attachment=$matches[1]&cpage=$matches[2]' (length=50)
    59   'events/[^/]+/attachment/([^/]+)/embed/?$' => string 'index.php?attachment=$matches[1]&embed=true' (length=43)
    60   'events/([^/]+)/embed/?$' => string 'index.php?event=$matches[1]&embed=true' (length=38)
    61   'events/([^/]+)/trackback/?$' => string 'index.php?event=$matches[1]&tb=1' (length=32)
    62   'events/([^/]+)(?:/([0-9]+))?/?$' => string 'index.php?event=$matches[1]&page=$matches[2]' (length=44)
    63   'events/[^/]+/([^/]+)/?$' => string 'index.php?attachment=$matches[1]' (length=32)
    64   'events/[^/]+/([^/]+)/trackback/?$' => string 'index.php?attachment=$matches[1]&tb=1' (length=37)
    65   'events/[^/]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?attachment=$matches[1]&feed=$matches[2]' (length=49)
    66   'events/[^/]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?attachment=$matches[1]&feed=$matches[2]' (length=49)
    67   'events/[^/]+/([^/]+)/comment-page-([0-9]{1,})/?$' => string 'index.php?attachment=$matches[1]&cpage=$matches[2]' (length=50)
    68   'events/[^/]+/([^/]+)/embed/?$' => string 'index.php?attachment=$matches[1]&embed=true' (length=43)
     53'events/[^/]+/attachment/([^/]+)/?$' => string 'index.php?attachment=$matches[1]' (length=32)
     54'events/[^/]+/attachment/([^/]+)/trackback/?$' => string 'index.php?attachment=$matches[1]&tb=1' (length=37)
     55'events/[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?attachment=$matches[1]&feed=$matches[2]' (length=49)
     56'events/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?attachment=$matches[1]&feed=$matches[2]' (length=49)
     57'events/[^/]+/attachment/([^/]+)/comment-page-([0-9]{1,})/?$' => string 'index.php?attachment=$matches[1]&cpage=$matches[2]' (length=50)
     58'events/[^/]+/attachment/([^/]+)/embed/?$' => string 'index.php?attachment=$matches[1]&embed=true' (length=43)
     59'events/([^/]+)/embed/?$' => string 'index.php?event=$matches[1]&embed=true' (length=38)
     60'events/([^/]+)/trackback/?$' => string 'index.php?event=$matches[1]&tb=1' (length=32)
     61'events/([^/]+)(?:/([0-9]+))?/?$' => string 'index.php?event=$matches[1]&page=$matches[2]' (length=44)
     62'events/[^/]+/([^/]+)/?$' => string 'index.php?attachment=$matches[1]' (length=32)
     63'events/[^/]+/([^/]+)/trackback/?$' => string 'index.php?attachment=$matches[1]&tb=1' (length=37)
     64'events/[^/]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?attachment=$matches[1]&feed=$matches[2]' (length=49)
     65'events/[^/]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => string 'index.php?attachment=$matches[1]&feed=$matches[2]' (length=49)
     66'events/[^/]+/([^/]+)/comment-page-([0-9]{1,})/?$' => string 'index.php?attachment=$matches[1]&cpage=$matches[2]' (length=50)
     67'events/[^/]+/([^/]+)/embed/?$' => string 'index.php?attachment=$matches[1]&embed=true' (length=43)
    6968}}}
    7069
     
    7473
    7574{{{#!php
    76 <?php
    77                                 if ( ! $post ) {
    78                                         // For custom post types, we need to add on endpoints as well.
    79                                         foreach ( get_post_types( array('_builtin' => false ) ) as $ptype ) {
    80                                                 if ( strpos($struct, "%$ptype%") !== false ) {
    81                                                         $post = true;
     75if ( ! $post ) {
     76        // For custom post types, we need to add on endpoints as well.
     77        foreach ( get_post_types( array('_builtin' => false ) ) as $ptype ) {
     78                if ( strpos($struct, "%$ptype%") !== false ) {
     79                        $post = true;
    8280
    83                                                         // This is for page style attachment URLs.
    84                                                         $page = is_post_type_hierarchical( $ptype );
    85                                                         break;
    86                                                 }
    87                                         }
    88                                 }
    89 
     81                        // This is for page style attachment URLs.
     82                        $page = is_post_type_hierarchical( $ptype );
     83                        break;
     84                }
     85        }
     86}
    9087}}}
    9188
     
    9491
    9592{{{#!php
    96 <?php
    97                                 // If we're matching a permalink, add those extras (attachments etc) on.
    98                                 if ( $post ) {
    99                                         // Add trackback.
    100                                         $rewrite = array_merge(array($trackbackmatch => $trackbackquery), $rewrite);
    101 
     93// If we're matching a permalink, add those extras (attachments etc) on.
     94if ( $post ) {
     95        // Add trackback.
     96        $rewrite = array_merge(array($trackbackmatch => $trackbackquery), $rewrite);
    10297}}}
    10398