2173 | | add_post_meta( $post_ID, 'enclosure', $enclosure['url'] . "\n" . $enclosure['length'] . "\n" . $enclosure['type'] ); |
| 2173 | |
| 2174 | $encstring = $enclosure['url'] . "\n" . $enclosure['length'] . "\n" . $enclosure['type']; |
| 2175 | $found = false; |
| 2176 | foreach ( (array) get_post_custom($post_ID) as $key => $val) { |
| 2177 | if ($key == 'enclosure') { |
| 2178 | foreach ( (array) $val as $enc ) { |
| 2179 | if ($enc == $encstring) { |
| 2180 | $found = true; |
| 2181 | break 2; |
| 2182 | } |
| 2183 | } |
| 2184 | } |
| 2185 | } |
| 2186 | if (!found) { |
| 2187 | add_post_meta( $post_ID, 'enclosure', $encstring ); |
| 2188 | } |
2456 | | add_post_meta( $post_ID, 'enclosure', $enclosure['url'] . "\n" . $enclosure['length'] . "\n" . $enclosure['type'] ); |
| 2471 | |
| 2472 | $encstring = $enclosure['url'] . "\n" . $enclosure['length'] . "\n" . $enclosure['type']; |
| 2473 | $found = false; |
| 2474 | foreach ( (array) get_post_custom($post_ID) as $key => $val) { |
| 2475 | if ($key == 'enclosure') { |
| 2476 | foreach ( (array) $val as $enc ) { |
| 2477 | if ($enc == $encstring) { |
| 2478 | $found = true; |
| 2479 | break 2; |
| 2480 | } |
| 2481 | } |
| 2482 | } |
| 2483 | } |
| 2484 | if (!found) { |
| 2485 | add_post_meta( $post_ID, 'enclosure', $encstring ); |
| 2486 | } |