Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter ld2002

    (@ld2002)

    Hey @nomnom99

    Thank you very much for your help. I created a small plugin and uploaded it to the website and it works fine. The IP-Adress is also shown on the settings-page. Everything i want works now.

    Here is my plugin:

    <?php
    /**
     * Plugin Name: Add IP to RSA
     */
    
    add_action( 'plugins_loaded', 'load_ip_adress' );
    
    function load_ip_adress()
    {
    $ip_address = file_get_contents('http://checkip.dyndns.org');
    $ip_address = preg_replace('/[^0-9.]/', '', $ip_address);
    $server_ip = $ip_address;
    Restricted_Site_Access::add_ips( array( 'five' => $server_ip) );
    }
    ?>

    Greetings

    Luca

    Thread Starter ld2002

    (@ld2002)

    Hey @wpmudevsupport13,
    Thanks for your help, I was actually able to solve it myself now. I programmed my own plugin that changes the role. I attach my solution here.
    Thanks again!
    <?php
    /**
    * Plugin Name: Change_username
    */
    function my_paypal_function($custom_form, $field, $paypal_entry_data, $submitted_data, $field_data_array){
    $current_user = wp_get_current_user();
    $current_user->set_role(“newrole”);
    }
    add_action(‘forminator_custom_form_after_paypal_charge’, ‘my_paypal_function’, 10, 5);
    ?>

Viewing 2 replies - 1 through 2 (of 2 total)