Forum Replies Created

Viewing 15 replies - 1 through 15 (of 44 total)
  • Thread Starter cimot456

    (@cimot456)

    Hi @ultimatemembersupport

    I’ve looked at the link, tried to create and get cookies.

    Can you tell me after these cookies are put in a variable, how can I send them to the register page?

    Thank you

    Thread Starter cimot456

    (@cimot456)

    Revise :

    Here’s the second additional code that has been updated

    global $wpdb;
    $regno_admin = "admin";
    	if(!isset($_GET['rs']) && is_page('offering')) {
    		echo '<a href="register?regno_subscriber='.$regno_admin.'"> Register Now</a>';
    	}else{
    	        $regno_partner = $_GET['rs'];
    		$code_field = $wpdb->get_results( "SELECT * FROM $wpdb->usermeta WHERE meta_key='regno_partner' AND meta_value='{$regno_partner}'" );
    if (!$code_field){
    			echo '<a href="register?regno_subscriber='.$regno_admin.'"> Register Now</a>';
    		}elseif(empty($regno_partner)){
    			echo '<a href="register?regno_subscriber='.$regno_admin.'"> Register Now</a>';
    		}else{	
    			echo '<a href="register?regno_subscriber='.$regno_partner.'"> Register Now</a>';				
    		}				
    }

    Thank you

    • This reply was modified 2 years, 5 months ago by cimot456.
    Thread Starter cimot456

    (@cimot456)

    @missveronicatv @champsupertramp

    I’ve tried several conditions when registering.

    So far there seems to be no problem. (And hopefully not).

    So I reconfirmed, for accepted the answer and thanks for the help.

    For that, I would like to mark this thread as resolved.

    Regards

    Thread Starter cimot456

    (@cimot456)

    @missveronicatv

    omg…

    I’m really stupid.

    Not read carefully.

    Even though you have explained clearly in the previous answer.

    I am really sorry.

    Now, the code that you created I have retested and it works perfectly as I want.

    I really thank you for your time and your help, I really appreciate it.

    Thread Starter cimot456

    (@cimot456)

    @missveronicatv

    I have tested it.

    However I haven’t been able to get it to work.

    When I register with random code – K249D (no partner has that code – regno_partner), registration is still successful.
    K249D is stored in regno_subscriber.

    With this condition the registration should be canceled and a message appears that “The code you entered is not valid).

    Can I ask for your help to review the code again?

    Thank You

    Thread Starter cimot456

    (@cimot456)

    @missveronicatv

    I will try it now

    Thread Starter cimot456

    (@cimot456)

    @missveronicatv

    Thank you in advance

    Thread Starter cimot456

    (@cimot456)

    halo…

    Thread Starter cimot456

    (@cimot456)

    @champsupertramp @missveronicatv

    For this topic you can close / mark as resolved.

    Really thank you

    Thread Starter cimot456

    (@cimot456)

    @champsupertramp

    Thank you for helping me.

    Here is the explanation after I used the code snippet you provided.

    1. Register by entering the P150K code in the unique code field > Saving the NUC01 value > it should be “P150K”

    2. Register by entering the code X123W in the unique code field > Saving the NUC01 value > it should be cancel the registration and display a message: The code you entered is invalid

    3. Register without entering a unique code > Saving the NUC01 value > This is correct

    I was wrong explaining at the beginning, in the “Robert as agent” section it should be “Robert as partner”..

    So please let me explain again.

    Behind I have a dynamic number of users with partner roles (eg 30 people).

    Each partner has a different code and is stored with the meta key “regno_partner”.

    Name : Michael
    roles : um_partner
    regno_partner : P150K

    Name : Samantha
    role : um_partner
    regno_partner : PL25K

    etc. (according to the number of registered partners)

    Partners share regno_partner (hereinafter referred to as a unique code) to potential customers/users as one of the conditions to get a discount when they buy one of our products.

    A unique code must be entered when the customer registers.
    For users who do not enter a unique code, they cannot apply for a discount or will get another program.

    For that, I need to create a form that dynamically checks whether a unique code is available or not.

    So I guess it would look like this:

    1. Consumers enter P150K unique code > Unique code – matching (Owned by Michael) > Continue registration > P150K unique code will be stored in the regno_subscriber meta key

    2. Consumers enter PL25K unique code > Unique code – matching (Owned by Samantha) > Continue registration > PL25K unique code will be stored in the regno_subscriber meta key

    3. The consumer enters a random/any unique code (example: X123W) > The unique code does not match (no partner has the unique code) > Cancel registration > Display a message to the field > Your unique code is invalid

    4. Consumers do not enter unique code / unique code field is empty / not filled in > Continue registration > Fill in unique code field with default value : NUC01 > Save value in regno_subscriber meta key

    I hope this additional information helps you.

    Thread Starter cimot456

    (@cimot456)

    @abhikr781

    The theme and ocean extra plugin are all latest versions.

    With pleasure..

    Here is the system info you’ll need…

    					
    == Server Environment ==
    	Operating System: Linux
    	Software: Apache
    	MySQL version: MariaDB Server v5.7.36
    	PHP Version: 7.4.27
    	PHP Max Input Vars: 1000
    	PHP Max Post Size: 8M
    	GD Installed: Yes
    	ZIP Installed: Yes
    	Write Permissions: All right
    	Elementor Library: Connected
    
    == WordPress Environment ==
    	Version: 5.9
    	Site URL: https://site.com
    	Home URL: https://site.com
    	WP Multisite: No
    	Max Upload Size: 4 MB
    	Memory limit: 256M
    	Permalink Structure: /%postname%/
    	Language: en-US
    	Timezone: 7
    	Admin Email: [email protected]
    	Debug Mode: Inactive
    
    == Theme ==
    	Name: OceanWP
    	Version: 3.1.3
    	Author: OceanWP
    	Child Theme: No
    
    == User ==
    	Role: administrator
    	WP Profile lang: en_US
    	User Agent: Mozilla/5.0 (Windows NT 6.1; rv:97.0) Gecko/20100101 Firefox/97.0
    
    == Active Plugins ==
    	Caldera Forms
    		Version: 1.9.6
    		Author: Caldera Forms
    
    	Classic Widgets
    		Version: 0.3
    		Author: WordPress Contributors
    
    	Code Snippets
    		Version: 2.14.3
    		Author: Code Snippets Pro
    
    	Easy WP SMTP
    		Version: 1.4.7
    		Author: wpecommerce, alexanderfoxc
    
    	Elementor
    		Version: 3.5.5
    		Author: Elementor.com
    
    	Elementor Addon Elements
    		Version: 1.11.13
    		Author: WPVibes
    
    	Ocean Extra
    		Version: 1.9.3
    		Author: OceanWP
    
    	Ultimate Member
    		Version: 2.3.1
    		Author: Ultimate Member
    
    	WooCommerce
    		Version: 6.2.0
    		Author: Automattic
    
    	WooCommerce Random Product Sorting with Pagination
    		Version: 0.9.2
    		Author: William Crowley
    
    	WOOF - WooCommerce Products Filter
    		Version: 1.2.6.4
    		Author: realmag777
    
    	WP Super Cache
    		Version: 1.7.7
    		Author: Automattic
    
    == Elementor Experiments ==
    	Optimized DOM Output: Active by default
    	Improved Asset Loading: Active by default
    	Improved CSS Loading: Active by default
    	Inline Font Icons: Inactive by default
    	Accessibility Improvements: Active by default
    	Import Export Template Kit: Active by default
    	Additional Custom Breakpoints: Active by default
    	Hide native WordPress widgets from search results: Active by default
    	Landing Pages: Active by default
    	Color Sampler: Active by default
    	Favorite Widgets: Active by default
    	Admin Top Bar: Active by default
    
    == Log ==
    	
    JS: showing 1 of 1JS: 2022-02-02 08:06:31 [error X 33][https://site.com/wp-content/plugins/elementor/assets/lib/tipsy/tipsy.min.js?ver=1.0.0:1:3776] this[binder] is not a function 
    
    PHP: showing 5 of 5PHP: 2022-02-03 02:34:47 [notice X 1][/home/tjholiya/public_html/wp-content/plugins/elementor/includes/autoloader.php::286] require(): read of 1361 bytes failed with errno=12 Cannot allocate memory [array (
      'trace' => '
    #0: Elementor\Core\Logger\Manager -> shutdown()
    ',
    )]
    PHP: 2022-02-03 02:35:14 [notice X 1][/home/tjholiya/public_html/wp-content/plugins/elementor/includes/autoloader.php::286] require(): read of 1224 bytes failed with errno=12 Cannot allocate memory [array (
      'trace' => '
    #0: Elementor\Core\Logger\Manager -> shutdown()
    ',
    )]
    PHP: 2022-02-03 02:35:15 [notice X 1][/home/tjholiya/public_html/wp-content/plugins/elementor/includes/autoloader.php::286] require(): read of 10230 bytes failed with errno=12 Cannot allocate memory [array (
      'trace' => '
    #0: Elementor\Core\Logger\Manager -> shutdown()
    ',
    )]
    PHP: 2022-02-13 17:23:12 [notice X 1][/home/tjholiya/public_html/wp-content/plugins/elementor/includes/autoloader.php::286] require(): read of 2417 bytes failed with errno=12 Cannot allocate memory [array (
      'trace' => '
    #0: Elementor\Core\Logger\Manager -> shutdown()
    ',
    )]
    PHP: 2022-02-13 19:18:13 [error X 2][/home/tjholiya/public_html/wp-content/plugins/elementor/includes/template-library/manager.php::457] Uncaught Error: Cannot use object of type WP_Error as array in /home/tjholiya/public_html/wp-content/plugins/elementor/includes/template-library/manager.php:457
    Stack trace:
    #0 [internal function]: Elementor\TemplateLibrary\Manager->import_template(Array)
    #1 /home/tjholiya/public_html/wp-content/plugins/elementor/includes/template-library/manager.php(550): call_user_func(Array, Array)
    #2 /home/tjholiya/public_html/wp-content/plugins/elementor/includes/template-library/manager.php(582): Elementor\TemplateLibrary\Manager->handle_ajax_request('import_template', Array)
    #3 [internal function]: Elementor\TemplateLibrary\Manager->Elementor\TemplateLibrary\{closure}(Array, Object(Elementor\Core\Common\Modules\Ajax\Module))
    #4 /home/tjholiya/public_html/wp-content/plugins/elementor/core/common/modules/ajax/module.php(171): call_user_func(Object(Closure), Array, Object(Elementor\Core\Common\Modules\Ajax\Module))
    #5 /home/tjholiya/public_html/wp-includes/class-wp-hook.php(307): Elementor\Core\Common\Modules\Ajax\Module- [array (
      'trace' => '
    #0: Elementor\Core\Logger\Manager -> shutdown()
    ',
    )]
    
    Log: showing 5 of 52022-02-04 02:28:51 [info] elementor::elementor_updater Started 
    2022-02-04 02:28:51 [info] Elementor/Upgrades - _on_each_version Start  
    2022-02-04 02:28:51 [info] Elementor/Upgrades - _on_each_version Finished 
    2022-02-04 02:28:51 [info] Elementor data updater process has been completed. [array (
      'plugin' => 'Elementor',
      'from' => '3.5.4',
      'to' => '3.5.5',
    )]
    2022-02-04 02:28:51 [info] Elementor data updater process has been queued. [array (
      'plugin' => 'Elementor',
      'from' => '3.5.4',
      'to' => '3.5.5',
    )]
    
    == Elementor - Compatibility Tag ==
    	
    	Elementor Addon Elements: Compatible
    				
    Thread Starter cimot456

    (@cimot456)

    @champsupertramp

    For now I need a fixed value, which is NUC01 for all registered users without entering a unique code.

    But if you don’t mind for sharing 2 in version, I’ll gladly accept it.

    Who knows in the future it will require different conditions, I already have it.

    Thank You

    Thread Starter cimot456

    (@cimot456)

    @missveronicatv

    Yes, I am using a unique mobile number to validate the field.

    As far as I remember this was explained in the README

    Mobile Number Validation

    Custom UM Field Validation: unique_mobile_number

    If mobile number contains blank/spaces and some of these characters + ( ) – . the stored meta value must have an exact match for identification. All other characters must be digits and no other alphabetic characters are allowed in the mobile number.

    Thanks again for your attention.

    Thread Starter cimot456

    (@cimot456)

    Finally…

    No more empty roles, no more extra effort,
    Perfect!

    You have done it…

    Now, I smile broadly:)

    really really thank you @missveronicatv

    • This reply was modified 2 years, 9 months ago by cimot456.
    Thread Starter cimot456

    (@cimot456)

    @missveronicatv

    Yes, with pleasure.

    add_action( 'show_user_profile', 'extra_user_profile_fields' );
    add_action( 'edit_user_profile', 'extra_user_profile_fields' );
    add_action( "user_new_form", "extra_user_profile_fields" );
    
    function extra_user_profile_fields( $user ) {
    
    ?>
    <h3><?php _e("Additional Information", "blank"); ?></h3>
    
    <table class="form-table">
        <tr>
            <th><label for="regno_admin"><?php _e("ID Admin"); ?></label></th>
            <td>
                <input type="text" name="regno_admin" id="regno_admin" value="<?php echo esc_attr( get_the_author_meta( 'regno_admin', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>
    	<tr>
            <th><label for="regno_partner"><?php _e("ID Partner"); ?></label></th>
            <td>
                <input type="text" name="regno_partner" id="regno_partner" value="<?php echo esc_attr( get_the_author_meta( 'regno_partner', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>
        <tr>
            <th><label for="regno_subscriber"><?php _e("ID Subscriber"); ?></label></th>
            <td>
                <input type="text" name="regno_subscriber" id="regno_subscriber" value="<?php echo esc_attr( get_the_author_meta( 'regno_subscriber', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>
        <tr>
            <th><label for="regno_customer"><?php _e("ID Customer"); ?></label></th>
            <td>
                <input type="text" name="regno_customer" id="regno_customer" value="<?php echo esc_attr( get_the_author_meta( 'regno_customer', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>	
        <tr>
            <th><label for="regno_owner"><?php _e("ID Owner"); ?></label></th>
            <td>
                <input type="text" name="regno_owner" id="regno_owner" value="<?php echo esc_attr( get_the_author_meta( 'regno_owner', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>
        <tr>
            <th><label for="regno_owner_refferal"><?php _e("ID Owner Refferal"); ?></label></th>
            <td>
                <input type="text" name="regno_owner_refferal" id="regno_owner_refferal" value="<?php echo esc_attr( get_the_author_meta( 'regno_owner_refferal', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>	
        <tr>
            <th><label for="regno_reseller"><?php _e("ID Reseller"); ?></label></th>
            <td>
                <input type="text" name="regno_reseller" id="regno_reseller" value="<?php echo esc_attr( get_the_author_meta( 'regno_reseller', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>
        <tr>
            <th><label for="regno_agent"><?php _e("ID Agent"); ?></label></th>
            <td>
                <input type="text" name="regno_agent" id="regno_agent" value="<?php echo esc_attr( get_the_author_meta( 'regno_agent', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>
        <tr>
            <th><label for="regno_agent_refferal"><?php _e("ID Agent Refferal"); ?></label></th>
            <td>
                <input type="text" name="regno_agent_refferal" id="regno_agent_refferal" value="<?php echo esc_attr( get_the_author_meta( 'regno_agent_refferal', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>	
        <tr>
            <th><label for="role"><?php _e("Roles"); ?></label></th>
            <td>
                <input type="text" name="role" id="role" value="<?php echo esc_attr( get_the_author_meta( 'role', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>	
        <tr>
            <th><label for="first_name"><?php _e("First Name"); ?></label></th>
            <td>
                <input type="text" name="first_name" id="first_name" value="<?php echo esc_attr( get_the_author_meta( 'first_name', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>	
        <tr>
            <th><label for="last_name"><?php _e("Last Name"); ?></label></th>
            <td>
                <input type="text" name="last_name" id="last_name" value="<?php echo esc_attr( get_the_author_meta( 'last_name', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>		
        <tr>
            <th><label for="full_name"><?php _e("Full Name"); ?></label></th>
            <td>
                <input type="text" name="full_name" id="full_name" value="<?php echo esc_attr( get_the_author_meta( 'full_name', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>
        <tr>
            <th><label for="user_login"><?php _e("Username"); ?></label></th>
            <td>
                <input type="text" name="user_login" id="user_login" value="<?php echo esc_attr( get_the_author_meta( 'user_login', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>
        <tr>
            <th><label for="nickname"><?php _e("Nickname"); ?></label></th>
            <td>
                <input type="text" name="nickname" id="nickname" value="<?php echo esc_attr( get_the_author_meta( 'nickname', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>
    <?php /*)    <tr>
            <th><label for="gender"><?php _e("Gender"); ?></label></th>
            <td>
                <input type="text" name="gender" id="gender" value="<?php echo esc_attr( get_the_author_meta( 'gender', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>*/?>
                <tr>
                    <th><label for="gender">Gender</label></th>
                    <td>
                        <select name="gender" id="gender" >
                            <option value="male" <?php selected( 'Male', get_the_author_meta( 'gender', $user->ID ) ); ?>>Male</option>
                            <option value="female" <?php selected( 'Female', get_the_author_meta( 'gender', $user->ID ) ); ?>>Female</option>
                        </select>
                    </td>
                </tr>
    	<tr>
            <th><label for="dob"><?php _e("Date Of Birthday"); ?></label></th>
            <td>
                <input type="text" name="dob" id="dob" value="<?php echo esc_attr( get_the_author_meta( 'dob', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>
    	<tr>
            <th><label for="address"><?php _e("Address"); ?></label></th>
            <td>
                <input type="text" name="address" id="address" value="<?php echo esc_attr( get_the_author_meta( 'address', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>
    	<tr>
            <th><label for="sub-district"><?php _e("Subdistrict"); ?></label></th>
            <td>
                <input type="text" name="sub-district" id="sub-district" value="<?php echo esc_attr( get_the_author_meta( 'sub-district', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>
    	<tr>
            <th><label for="district"><?php _e("District"); ?></label></th>
            <td>
                <input type="text" name="district" id="district" value="<?php echo esc_attr( get_the_author_meta( 'district', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>
    	<tr>
            <th><label for="cities"><?php _e("Cities"); ?></label></th>
            <td>
                <input type="text" name="cities" id="cities" value="<?php echo esc_attr( get_the_author_meta( 'cities', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>
        <tr>
            <th><label for="provinces"><?php _e("Provinces"); ?></label></th>
            <td>
                <input type="text" name="provinces" id="provinces" value="<?php echo esc_attr( get_the_author_meta( 'provinces', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>
        <tr>
            <th><label for="zip_code"><?php _e("Zipcode"); ?></label></th>
            <td>
                <input type="text" name="zip_code" id="zip_code" value="<?php echo esc_attr( get_the_author_meta( 'zip_code', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>
        <tr>
            <th><label for="mobile_number"><?php _e("No Telp"); ?></label></th>
            <td>
                <input type="text" name="mobile_number" id="mobile_number" value="<?php echo esc_attr( get_the_author_meta( 'mobile_number', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>
        <tr>
            <th><label for="whatsapp"><?php _e("Whatsapp"); ?></label></th>
            <td>
                <input type="text" name="whatsapp" id="whatsapp" value="<?php echo esc_attr( get_the_author_meta( 'whatsapp', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>
        <tr>
            <th><label for="accountnumb"><?php _e("Account"); ?></label></th>
            <td>
                <input type="text" name="accountnumb" id="accountnumb" value="<?php echo esc_attr( get_the_author_meta( 'accountnumb', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>
        <tr>
            <th><label for="bank"><?php _e("Bank"); ?></label></th>
            <td>
                <input type="text" name="bank" id="bank" value="<?php echo esc_attr( get_the_author_meta( 'bank', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>
        <tr>
            <th><label for="accountname"><?php _e("Account Name"); ?></label></th>
            <td>
                <input type="text" name="accountname" id="accountname" value="<?php echo esc_attr( get_the_author_meta( 'accountname', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>
        <tr>
            <th><label for="buktab"><?php _e("Cover Bank"); ?></label></th>
            <td>
                <input type="text" name="buktab" id="buktab" value="<?php echo esc_attr( get_the_author_meta( 'buktab', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>
        <tr>
            <th><label for="ktpmtr"><?php _e("ID Card Partner "); ?></label></th>
            <td>
                <input type="text" name="ktpmtr" id="ktpmtr" value="<?php echo esc_attr( get_the_author_meta( 'ktpmtr', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>
        <tr>
            <th><label for="profile_photo"><?php _e("URL Foto"); ?></label></th>
            <td>
                <input type="text" name="profile_photo" id="profile_photo" value="<?php echo esc_attr( get_the_author_meta( 'profile_photo', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>
        <tr>
            <th><label for="instagram"><?php _e("Instagram"); ?></label></th>
            <td>
                <input type="text" name="instagram" id="instagram" value="<?php echo esc_attr( get_the_author_meta( 'instagram', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>
        <tr>
            <th><label for="facebook"><?php _e("Facebook"); ?></label></th>
            <td>
                <input type="text" name="facebook" id="facebook" value="<?php echo esc_attr( get_the_author_meta( 'facebook', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e(""); ?></span>
            </td>
        </tr>
    </table>
    <?php }
    
    add_action( 'personal_options_update', 'save_extra_user_profile_fields' );
    add_action( 'edit_user_profile_update', 'save_extra_user_profile_fields' );
    add_action( 'user_register', 'save_extra_user_profile_fields' );
    function save_extra_user_profile_fields( $user_id ) {
    
    if ( !current_user_can( 'edit_user', $user_id ) ) { return false; }
    update_user_meta( $user_id, 'regno_admin', $_POST['regno_admin'] );
    update_user_meta( $user_id, 'regno_partner', $_POST['regno_partner'] );
    update_user_meta( $user_id, 'regno_subscriber', $_POST['regno_subscriber'] );
    update_user_meta( $user_id, 'regno_customer', $_POST['regno_customer'] );
    update_user_meta( $user_id, 'regno_owner', $_POST['regno_owner'] );
    update_user_meta( $user_id, 'regno_owner_refferal', $_POST['regno_owner_refferal'] );	
    update_user_meta( $user_id, 'regno_reseller', $_POST['regno_reseller'] );
    update_user_meta( $user_id, 'regno_agent', $_POST['regno_agent'] );	
    update_user_meta( $user_id, 'regno_agent_refferal', $_POST['regno_agent_refferal'] );
    update_user_meta( $user_id, 'first_name', $_POST['first_name'] );	
    update_user_meta( $user_id, 'last_name', $_POST['last_name'] );	
    update_user_meta( $user_id, 'full_name', $_POST['full_name'] );
    update_user_meta( $user_id, 'user_login', $_POST['user_login'] );
    update_user_meta( $user_id, 'nickname', $_POST['nickname'] );	
    update_user_meta( $user_id, 'gender', $_POST['gender'] );
    update_user_meta( $user_id, 'dob', $_POST['dob'] );
    update_user_meta( $user_id, 'address', $_POST['address'] );
    update_user_meta( $user_id, 'sub-district', $_POST['sub-district'] );
    update_user_meta( $user_id, 'district', $_POST['district'] );	
    update_user_meta( $user_id, 'cities', $_POST['cities'] );
    update_user_meta( $user_id, 'provinces', $_POST['provinces'] );
    update_user_meta( $user_id, 'zip_code', $_POST['zip_code'] );
    update_user_meta( $user_id, 'mobile_number', $_POST['mobile_number'] );
    update_user_meta( $user_id, 'whatsapp', $_POST['whatsapp'] );
    update_user_meta( $user_id, 'accountnumb', $_POST['accountnumb'] );
    update_user_meta( $user_id, 'bank', $_POST['bank'] );	
    update_user_meta( $user_id, 'accountname', $_POST['accountname'] );
    update_user_meta( $user_id, 'buktab', $_POST['buktab']);	
    update_user_meta( $user_id, 'ktpmtr', $_POST['ktpmtr'] );
    update_user_meta( $user_id, 'profile_photo', $_POST['profile_photo']);
    update_user_meta( $user_id, 'instagram', $_POST['instagram'] );
    update_user_meta( $user_id, 'facebook', $_POST['facebook'] );
    	
    UM()->user()->remove_cache( $user_id );
            um_fetch_user( $user_id );	
    }
    
Viewing 15 replies - 1 through 15 (of 44 total)