Iframe disappears when author updates page

Note that allowing iframes directly in a post content area can be dangerous, that’s why they’re stripped out for security reasons. Super admins on multisites or administrators on single sites have the unfiltered_html capability, and can insert anything they please into a post content area, but this is dangerous. For example, granting your author this … Read more

New user is assigned 2 roles: customer and superadmin

To restore super admin to just the admin username: <?php update_site_option( ‘site_admins’, array(‘admin’) ); ?> Place a PHP file with this line in your /wp-content/mu-plugins/ directory and access any site URL. Once done you can delete the file. Alternative you can edit the site_admins key directly in the wp_sitemeta table (but the first is easier … Read more

Assign a role to the user who registers on a form

$POST = filter_var_array($_POST, FILTER_SANITIZE_STRING); $nome = $POST[‘nome’]; $cognome = $POST[‘cognome’]; $email = $POST[’email’]; $token = $POST[‘stripeToken’]; $nickname = $nome . ‘ ‘ . $cognome; // Inserisce utente nel DB $user_data = [ ‘user_login’ => $nickname, ‘user_pass’ => wp_generate_password (), ‘user_email’ => $email, ]; $user_id = wp_insert_user($user_data); update_user_meta( $user_id, ‘first_name’, $nome); update_user_meta( $user_id, ‘last_name’, $cognome); update_user_meta( … Read more