Allow 0 for postmeta, fixes #1912

git-svn-id: https://develop.svn.wordpress.org/trunk@3221 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg 2005-11-28 10:21:23 +00:00
parent 83bca28d72
commit 83ac138c9d
1 changed files with 1 additions and 1 deletions

View File

@ -869,7 +869,7 @@ function add_meta($post_ID) {
$metakeyinput = $wpdb->escape(stripslashes(trim($_POST['metakeyinput'])));
$metavalue = $wpdb->escape(stripslashes(trim($_POST['metavalue'])));
if (!empty ($metavalue) && ((('#NONE#' != $metakeyselect) && !empty ($metakeyselect)) || !empty ($metakeyinput))) {
if ( ('0' === $metavalue || !empty ($metavalue)) && ((('#NONE#' != $metakeyselect) && !empty ($metakeyselect)) || !empty ($metakeyinput)) ) {
// We have a key/value pair. If both the select and the
// input for the key have data, the input takes precedence: