-
Hello FV Player Support,
I am trying to customize the DRM Text Watermark so that it shows only the user’s phone number (without any prefix like “Name:”).
Currently, no matter what I try, the overlay always appears as:
Name: 797845455
But what I need is only:
797845455
Here is the code I am currently using in my functions.php:
function my_drm_find_phone_nocc( $user_id ) { // Most-likely meta keys used by Xoo-ML / XootiX plugins $candidates = array( 'xoo-ml-user-reg-phone', // matches your form field name 'xoo_ml_user_reg_phone', 'xoo_ml_phone', 'xoo-ml-phone', 'xoo_ml_phone_no', 'xoo_ml_phone_nocc', 'user_phone', 'phone', ); // Country code (if stored separately) $cc_raw = get_user_meta( $user_id, 'xoo-ml-user-reg-phone-cc', true ); $cc_digits = $cc_raw ? preg_replace( '/\D+/', '', $cc_raw ) : ''; foreach ( $candidates as $key ) { $val = get_user_meta( $user_id, $key, true ); if ( is_string( $val ) && $val !== '' ) { $digits = preg_replace( '/\D+/', '', $val ); // If the value begins with the CC, strip it off if ( $cc_digits && strpos( $digits, $cc_digits ) === 0 ) { $digits = substr( $digits, strlen( $cc_digits ) ); } // Return as-is (digits only, keeps leading zeroes if present) return $digits; } } // Optional fallback to Woo billing phone (still remove CC if present) $billing = get_user_meta( $user_id, 'billing_phone', true ); if ( $billing ) { $digits = preg_replace( '/\D+/', '', $billing ); if ( $cc_digits && strpos( $digits, $cc_digits ) === 0 ) { $digits = substr( $digits, strlen( $cc_digits ) ); } return $digits; } return ''; } /** * Append phone (no country code) to FV Player Pro DRM "name". */ function tweak_fv_player_pro_drm_text( $data ) { $user = wp_get_current_user(); if ( $user && $user->ID ) { $phone = my_drm_find_phone_nocc( $user->ID ); if ( $phone !== '' ) { $data['name'] .= ' ' . $phone; } } return $data; } add_filter( 'fv_player_pro_drm_text', 'tweak_fv_player_pro_drm_text', 20 );
No matter if I overwrite or append, FV Player seems to automatically prepend “Name:” to the DRM text.
Could you please clarify:
How to completely remove the “Name:” prefix from the DRM overlay?
Is there a built-in filter or option to control the output format of the DRM text (instead of hardcoding “Name:”)?
Thank you in advance!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)