From 10656cb1ebb4fe7236a3db7a6a1cb8a9d9b1290f Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 16 Mar 2010 16:34:30 +0000 Subject: [PATCH] Use get_permalink() instead of get_post_permalink(). Limit to published post types. see #11817 #12566 git-svn-id: http://svn.automattic.com/wordpress/trunk@13714 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/nav-menu.php | 2 +- wp-includes/nav-menu.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/nav-menu.php b/wp-admin/includes/nav-menu.php index da5cf18e18..fe100a45f9 100644 --- a/wp-admin/includes/nav-menu.php +++ b/wp-admin/includes/nav-menu.php @@ -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'; diff --git a/wp-includes/nav-menu.php b/wp-includes/nav-menu.php index 607bb3c8e9..6f4c441e2e 100644 --- a/wp-includes/nav-menu.php +++ b/wp-includes/nav-menu.php @@ -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 = '';