Don’t register legacy settings without IDs.

This commit is contained in:
Jeff Stieler 2016-06-08 10:25:07 -06:00 committed by Justin Shreve
parent 9d9d318727
commit bbc5aec1d1
1 changed files with 3 additions and 0 deletions

View File

@ -56,6 +56,9 @@ class WC_Register_Legacy_Settings {
foreach ( $legacy_sections as $legacy_section => $legacy_section_label ) {
$legacy_settings = $this->page->get_settings( $legacy_section );
foreach ( $legacy_settings as $legacy_setting ) {
if ( ! isset( $legacy_setting['id'] ) ) {
continue;
}
$new_setting = array(
'id' => $legacy_setting['id'],
'label' => ( ! empty( $legacy_setting['title'] ) ? $legacy_setting['title'] : '' ),