You appear to be a bot. Output may be restricted
Description
Update post_meta for fields with multiple valuesDelete any existing meta data values then add the new ones, if any
Usage
bw_update_post_meta( $post_id, $field, $mydata );
Parameters
- $post_id
- ( ID ) required –
- $field
- ( string ) required – the field name – often preceded with an '_'
- $mydata
- ( array ) required – the set of new values
Returns
voidSource
File name: oik/includes/bw_metadata.phpLines:
1 to 8 of 8
function bw_update_post_meta( $post_id, $field, $mydata ) { delete_post_meta( $post_id, $field ); if ( is_array( $mydata) && count( $mydata ) ) { foreach ( $mydata as $key => $value ) { add_post_meta( $post_id, $field, $value, false ); } } }View on GitHub View on Trac