Opened 12 years ago
Closed 12 years ago
#21655 closed defect (bug) (fixed)
Incorrect URL For Theme Options With Custom Post Type
Reported by: | jarretc | Owned by: | ryan |
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | normal | Version: | 3.4.1 |
Component: | Themes | Keywords: | has-patch needs-testing commit |
Focuses: | Cc: |
Description
Steps to reproduce:
- Register a custom post type or any other item that gets added to the Options menu under Appearance->Themes(themes.php)
- Set CPT show_in_menu value to themes.php or require capability edit_theme_options
- View link in Appearance->Themes(themes.php) under the Options row for current active theme
Patch adds a check to see if edit_theme_options is used and if not, then remove the themes.php?page= that gets added to the URL.
Attachments (3)
Change History (12)
#3
@
12 years ago
This doesn't have anything to do with the Appearance->Test URL. It has to do with the URL on the Appearance->Themes page.
See attached screenshot for the area I'm referring to.
This is the exact code that I have in Twentytwelve functions.php...
function jarret_test() { register_post_type( 'test', array( 'label' => 'Test', 'public' => true, 'show_in_menu' => 'themes.php', ) ); } add_action('init', 'jarret_test');
#4
@
12 years ago
Ah, I see. Another option (implemented in 21655.patch) would probably be to check if the parent file exists, like we already do in several places in menu-header.php
:
http://core.trac.wordpress.org/browser/tags/3.4.1/wp-admin/menu-header.php#L96
#5
@
12 years ago
Ok, well you know way more than I do so I'm sure that your patch will/does cover a lot more cases than mine.
Couldn't reproduce on a clean install with Twenty Twelve.
My steps:
If I set
capability_type
to'edit_theme_options'
, Appearance → Test item doesn't appear at all, Twenty Twelve's Theme Options URL is still correct.Is there anything I'm missing? Could you paste the code that causes the issue?