options->noConflict(); $dynamicOptions = aioseo()->dynamicOptions->noConflict(); foreach ( $mappings as $name => $values ) { if ( ! isset( $group[ $name ] ) ) { continue; } $error = false; $options = ! empty( $values['dynamic'] ) ? $dynamicOptions : $mainOptions; $lastOption = ''; for ( $i = 0; $i < count( $values['newOption'] ); $i++ ) { $lastOption = $values['newOption'][ $i ]; if ( ! $options->has( $lastOption, false ) ) { $error = true; break; }; if ( count( $values['newOption'] ) - 1 !== $i ) { $options = $options->$lastOption; } } if ( $error ) { continue; } switch ( $values['type'] ) { case 'boolean': if ( ! empty( $group[ $name ] ) ) { $options->$lastOption = true; break; } $options->$lastOption = false; break; case 'integer': case 'float': $value = aioseo()->helpers->sanitizeOption( $group[ $name ] ); if ( $value ) { $options->$lastOption = $value; } break; default: $value = $group[ $name ]; if ( $convertMacros ) { $value = $this->macrosToSmartTags( $value ); } $options->$lastOption = aioseo()->helpers->sanitizeOption( $value ); break; } } } }