Fix CPT links in Theme Options list. Props SergeyBiryukov, JarretC. fixes #21655

git-svn-id: http://core.svn.wordpress.org/trunk@21969 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Ryan Boren 2012-09-24 13:20:51 +00:00
parent a678273b61
commit 43d0bc1ed7

View File

@ -174,7 +174,10 @@ $customize_title = sprintf( __( 'Customize “%s”' ), $ct->display('Na
else
$options[] = "<a href='{$submenu[$item[2]][0][2]}'$class>{$item[0]}</a>";
} else if ( current_user_can($item[1]) ) {
if ( file_exists(ABSPATH . 'wp-admin/' . $item[2]) ) {
$menu_file = $item[2];
if ( false !== ( $pos = strpos( $menu_file, '?' ) ) )
$menu_file = substr( $menu_file, 0, $pos );
if ( file_exists( ABSPATH . "wp-admin/$menu_file" ) ) {
$options[] = "<a href='{$item[2]}'$class>{$item[0]}</a>";
} else {
$options[] = "<a href='themes.php?page={$item[2]}'$class>{$item[0]}</a>";