'; if( !empty( $details['default-option'] ) && $details['default-option'] ) $element .= ''; $field_name = Wordpress_Creation_Kit_PB::wck_generate_slug( $details['title'], $details ); // we're passing this further to a function. Need to make sure it exists so we don't get a notice. if( empty( $details['value'] ) ){ $details['value'] = false; } $options = ''; if( !empty( $details['options'] ) ){ $new_nonexisting_value = true; $i = 0; foreach( $details['options'] as $option ){ $optionOutput = Wordpress_Creation_Kit_PB::wck_generate_select_option($option, $details['value'], $i, $value); $options .= apply_filters("wck_select_{$meta}_{$field_name}_option_{$i}", $optionOutput, $i); $i++; if( !empty( $value ) && ( $option === $value || strpos( $option, '%'.$value ) !== false ) )//it is not a custom value because it is present in the options $new_nonexisting_value = false; } //display the custom value that was inserted with select 2 that was not present in options if( $new_nonexisting_value ) $options .= ''; } $element .= apply_filters( "wck_select_{$meta}_{$field_name}_options", $options ); $element .= ''; $element .= '';