MAke sure post_parent is valid.

git-svn-id: https://develop.svn.wordpress.org/trunk@3354 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2005-12-24 05:34:50 +00:00
parent 1d06871ca5
commit ddbd1e3ac3

View File

@ -273,7 +273,10 @@ function wp_insert_attachment($object, $file = false, $post_parent = 0) {
else
$to_ping = '';
if ( isset($post_parent) )
$post_parent = (int) $post_parent;
else
$post_parent = 0;
if ( isset($menu_order) )
$menu_order = (int) $menu_order;