Meta Box
Support › MB Settings Page › Delete options field MB Settings PageResolved
Hi I know that I can update fields with the below condition
// CODE UPDATE $option = get_option( 'settings' ); $option['new-text'] = $option['Text-old']; update_option( 'settings', $option );
But now I need to know the way to get a field and clear that field just and not any block of options using wordpress delete_options
I need to clear old fields so that it does not hide space in the database.
Thanks for the great work with Meta Box
Hi,
The old field is an element in the option array. To delete it, simply unset it:
$option = get_option( 'settings' ); $option['new-text'] = $option['Text-old']; // THIS unset( $option['Text-old'] ); update_option( 'settings', $option );