Use get_permalink() instead of get_post_permalink(). Limit to published post types. see #11817 #12566

git-svn-id: https://develop.svn.wordpress.org/trunk@13714 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2010-03-16 16:34:30 +00:00
parent accb84ed22
commit 586b69b6f6
2 changed files with 2 additions and 2 deletions

View File

@ -149,7 +149,7 @@ function wp_nav_menu_item_link_metabox() {
* @param string $post_type The post type object.
*/
function wp_nav_menu_item_post_type_metabox( $object, $post_type ) {
$args = array( 'post_type' => $post_type['args']->name, );
$args = array( 'post_type' => $post_type['args']->name, 'post_status' => 'publish' );
if ( 'attachment' == $post_type['args']->name )
$args['post_status'] = 'any';

View File

@ -210,7 +210,7 @@ function wp_setup_nav_menu_item( $menu_item, $menu_item_type = null, $menu_item_
$menu_item->append = _x( $object->singular_label, 'nav menu item type' );
$menu_item->title = $menu_item->post_title;
$menu_item->url = get_post_permalink( $menu_item->ID );
$menu_item->url = get_permalink( $menu_item->ID );
$menu_item->target = '_none';
$menu_item->attr_title = '';