'_mp3_url',
'title' => __( 'MP3 URL:', 'wordsmith' ),
'description' => __( 'Input the full URL to your audio file, only used for the Audio post format.', 'wordsmith' ),
'type' => 'text'
);
}
$meta = apply_filters( "{$prefix}_{$type}_meta_boxes", $meta );
return apply_filters( "{$prefix}_{$type}_meta_box_args", $meta );
}
/* Displays the post meta box on the edit post page. */
function framework_post_meta_box( $object, $box ) {
/* Get the theme prefix. */
$prefix = framework_get_prefix();
$meta_box_options = framework_post_meta_box_args( $object->post_type );
?>
post_type}_meta_box_nonce"; ?>" value="" />
ID, $option['name'], true ) ); }
?>
$val ) { ?>
name="" type="radio" value="" />
cap->edit_post, $post_id ) )
return $post_id;
/* Get the post meta box arguments. */
$metadata = framework_post_meta_box_args( $_POST['post_type'] );
/* Loop through all of post meta box arguments. */
foreach ( $metadata as $meta ) {
/* Get the meta value of the custom field key. */
$meta_value = get_post_meta( $post_id, $meta['name'], true );
/* Get the meta value the user input. */
$new_meta_value = stripslashes( $_POST[ preg_replace( "/[^A-Za-z_-]/", '-', $meta['name'] ) ] );
/* If a new meta value was added and there was no previous value, add it. */
if ( $new_meta_value && '' == $meta_value )
add_post_meta( $post_id, $meta['name'], $new_meta_value, true );
/* If the new meta value does not match the old value, update it. */
elseif ( $new_meta_value && $new_meta_value != $meta_value )
update_post_meta( $post_id, $meta['name'], $new_meta_value );
/* If there is no new meta value but an old value exists, delete it. */
elseif ( '' == $new_meta_value && $meta_value )
delete_post_meta( $post_id, $meta['name'], $meta_value );
}
}
?>