Making WordPress.org

Changeset 13259


Ignore:
Timestamp:
03/01/2024 01:09:36 AM (4 months ago)
Author:
dd32
Message:

Plugin Directory: Support ?p=8 queries for page shortlinks.

Props benniledl for the report.
See #7498.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php

    r13223 r13259  
    780780            $wp_query->query_vars['post_type']   = array( 'plugin' );
    781781            $wp_query->query_vars['post_status'] = array( 'publish' );
     782
     783            // Support queries for `?p=...` for pages, as it's used as the shortlink.
     784            if ( ! empty( $wp_query->query_vars['p'] ) ) {
     785                $wp_query->query_vars['post_type'][] = 'page';
     786            }
    782787        }
    783788
Note: See TracChangeset for help on using the changeset viewer.