HEX
Server: Apache
System: Linux d5123.usc1.stableserver.net 5.14.0-570.17.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Sat May 24 12:53:17 EDT 2025 x86_64
User: d5123 (1001)
PHP: 8.4.21
Disabled: NONE
Upload Files
File: /home/d5123/myboofola_com/wp-content/plugins/user-verification/includes/functions-user-profile.php
<?php
if (!defined('ABSPATH')) exit;  // if direct access 


add_action('show_user_profile', 'edit_user_profile');
add_action('edit_user_profile', 'edit_user_profile');

add_action('personal_options_update',  'save_update_user_profile');
add_action('edit_user_profile_update', 'save_update_user_profile');



function save_update_user_profile($user_id)
{


    if (!current_user_can('edit_user', $user_id)) {
        return false;
    }

    $option_value = isset($_POST['phone_number']) ? sanitize_text_field($_POST['phone_number']) : '';


    update_user_meta($user_id, 'phone_number', $option_value);
}


function edit_user_profile($user)
{

    $user_id = $user->ID;

    $phone_number = get_user_meta($user_id, 'phone_number', true);


?>
    <h2><?php echo esc_html_e('User Verification', 'user-verification'); ?></h2>
    <table class="form-table">
        <?php
        ?>
        <tr>
            <th><label><?php echo esc_html_e('Phone number', 'user-verification'); ?></label></th>
            <td>
                <input type="number" name="phone_number" id="phone_number" placeholder="" value="<?php echo esc_attr($phone_number); ?>" class="regular-text">
            </td>
        </tr>
        <?php


        ?>
    </table>
<?php

}