#18396 closed defect (bug) (wontfix)
Custom post type of "tab" creates query conflict with media uploader.
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.0 |
Component: | Query | Keywords: | |
Focuses: | Cc: |
Description
- Create a custom post type with name "tab"
- Upload media in (either attached to a post, or not)
- Return to media uploader and click on "Library" tab, no images are pulled
The query being called will check for a post_type of tab with the post_name library, looks like it's due to "tab=library" being in the query string. Change the post type or remove the its registration and the problem disappears.
Details: WP 3.0+ (trunk, too), no plugins, TwentyEleven child theme only having a functions.php with the register_post_type function called on init.
I'd love to submit a patch to account for this or it could be listed as a reserved word for custom post types. Looking for direction for next steps.
Change History (12)
#4
@
14 years ago
Because of this you should always prefix your names.
http://codex.wordpress.org/Post_Types#Naming_Best_Practices
#5
@
14 years ago
Noted, Alex Mills also pointed this out to me during my session at WCSF.
@johnbillion spoke with Nacin the same day, this is the case... being that I'm relatively new to working with core, can I simply work on and submit a patch or is any approval required?
If it's something that's going to be closed, would rather look at an open bug/ticket for my first patch.
#8
in reply to:
↑ 3
@
13 years ago
Replying to johnbillion:
I haven't checked, but wouldn't this also apply to any CPT that shares a name with a public query var?
There would be a problem only if the CPT's query variable overwrites an existing public query variable.
tab
is not a registered query variable. We consult it via a direct $_GET
.
#9
@
12 years ago
- Component changed from Media to Query
What this is doing is setting a name and tab query_variable.
dump of the library tab query:
object(WP_Query)[187] public 'query_vars' => array (size=51) 'm' => int 0 'cat' => string '0' (length=1) 'paged' => int 1 'post_type' => string 'attachment' (length=10) 'tab' => string 'library' (length=7) 'name' => string 'library' (length=7) 'posts_per_page' => int 20 'post_status' => string 'inherit,private' (length=15) 'error' => string '' (length=0) //.....
Investigating further
#10
@
12 years ago
- Keywords close added
I think this can be closed since the old media libary is gone.
I haven't checked, but wouldn't this also apply to any CPT that shares a name with a public query var?