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

git-svn-id: https://develop.svn.wordpress.org/trunk@21969 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2012-09-24 13:20:51 +00:00
parent 48cd2a2299
commit 65804be624

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>";