@michaelpersch
You can try using this filter hook where the Privacy tab initial values are comma separated fields and you can add your custom fields like in my example:
$args = 'profile_privacy,profile_noindex,hide_in_members';
Example:
add_filter( 'um_account_tab_privacy_fields', 'my_account_tab_privacy_fields', 10, 2 );
function my_account_tab_privacy_fields( $args, $shortcode_args ) {
$args .= ',custom_field_1,custom_field_2';
return $args;
}
Add your code snippet to your active theme’s functions.php file
or use the “Code Snippets” plugin.
Filter hook definition:
/**
* UM hook
*
* @type filter
* @title um_account_tab_privacy_fields
* @description Extend Account Tab Privacy
* @input_vars
* [{"var":"$args","type":"array","desc":"Account Arguments"},
* {"var":"$shortcode_args","type":"array","desc":"Account Shortcode Arguments"}]
* @change_log
* ["Since: 2.0"]
* @usage add_filter( 'um_account_tab_privacy_fields', 'function_name', 10, 2 );
* @example
* <?php
* add_filter( 'um_account_tab_privacy_fields', 'my_account_tab_privacy_fields', 10, 2 );
* function my_account_tab_privacy_fields( $args, $shortcode_args ) {
* // your code here
* return $args;
* }
* ?>
*/
-
This reply was modified 1 year, 12 months ago by missveronica.