WordPress.org

Making WordPress.org

Changes between Version 1 and Version 2 of Ticket #2787, comment 7


Ignore:
Timestamp:
05/04/17 09:32:04 (8 months ago)
Author:
SergeyBiryukov
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #2787, comment 7

    v1 v2  
    44 
    55 
    6 [source:sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php?rev=5463&marks=1164#L1160 Plugin_Directory::get_plugin_post()] includes a list of 7 plugin statuses to query: `'publish', 'pending', 'disabled', 'closed', 'new', 'draft', 'approved'`, but [source:sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php?rev=5463&marks=758#L755 Plugin_Directory::pre_get_posts()] overrides that list and limits the query to 4 statuses `'approved', 'publish', 'closed', 'disabled'` (note that lack of `'new'`), so the check for duplicate slug is bypassed. 
     6[source:sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php?rev=5463&marks=1164#L1160 Plugin_Directory::get_plugin_post()] includes a list of 7 plugin statuses to query: `'publish', 'pending', 'disabled', 'closed', 'new', 'draft', 'approved'`, but [source:sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php?rev=5463&marks=758#L755 Plugin_Directory::pre_get_posts()] overrides that list and limits the query to 4 statuses `'approved', 'publish', 'closed', 'disabled'` (note the lack of `'new'`), so the check for duplicate slug is bypassed. 
    77 
    88Adding `! $wp_query->is_main_query()` to `Plugin_Directory::pre_get_posts()`, as in