Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.4 kB
1
Indexable
Never
add_action('b2bking_custom_new_subaccount_fields', function(){
	?>
	<br>
	<div class="b2bking_subaccounts_new_account_container_content_element">
		<div class="b2bking_subaccounts_new_account_container_content_element_label">
			<?php esc_html_e('Store Code','b2bking'); ?>
		</div>
		<input type="text" class="b2bking_subaccounts_new_account_container_content_element_text" name="b2bking_store_code" placeholder="<?php esc_attr_e('Enter the store code here...','b2bking'); ?>">
	</div>
	<div class="b2bking_subaccounts_new_account_container_content_element b2bking_subaccount_horizontal_line">
		<div class="b2bking_subaccounts_new_account_container_content_element_label">
			<?php esc_html_e('Store ID','b2bking'); ?>
		</div>
		<input type="text" class="b2bking_subaccounts_new_account_container_content_element_text" name="b2bking_store_id" placeholder="<?php esc_attr_e('Enter the store id here...','b2bking'); ?>" >
	</div>
	<?php
});

add_filter('b2bking_custom_new_subaccount_field_names', function($fields){
	$fields = array('b2bking_store_code', 'b2bking_store_id');
	return $fields;
}, 10, 1);

add_filter('b2bking_custom_field_meta', function($field_name){
	// you can set a custom user meta key here
	if ($field_name === 'b2bking_store_code'){
		$field_name = 'store_code';
	}
	if ($field_name === 'b2bking_store_id'){
		$field_name = 'storeid';
	}
	return $field_name;
}, 10, 1);