Send registration email to all admins

Better try something like this: add_action( ‘register_new_user’, ‘send_admin_registration_email’, 99, 1 ); function send_admin_registration_email( $user_id ) { $user_info = get_userdata( $user_id ); $first_name = $user_info->first_name; $last_name = $user_info->last_name; $user_login = $user_info->user_login; $subject=”Family Medicine Residency Site Registration”; $message=”<p><b>Name:</b> ” . esc_html( $first_name ) . ‘ ‘ . esc_html( $last_name ) . ‘</p>’; $message .= ‘<p><b>Username:</b> ‘ . … Read more

Changing src URL on page id

Instead of saying “its not working” it would be more informative to describe what’s happening. You should first put the iFrame URL into a variable ratther than writing the iFram HTML code twice: <?php $page_id = get_queried_object_id(); // default iFrame src $iFrameSrc = “URL A”; if($page_id == 5232) { $iFrameSrc = “URL B”; } ?> … Read more

How can I process a form submission from an HTTP POST request?

you can use admin-post.php to process the form. you can set the form like that : <form action=”<?= htmlspecialchars(admin_url(“admin-post.php?action=MY_PLUGIN__my_action”))?>” method=”POST” > <button name=”send”>go</button> </form> and then you link the code with that : add_action(“admin_init”, function () { if ( !isset($_GET[“action”]) || (“MY_PLUGIN__my_action” !== $_GET[“action”]) ) { return; } /* */ // debug var_export($_POST); exit(); /* … Read more

Inserting more than one array into same row

foreach loops over a single variable. Here you have two, so using foreach is not the right method. Or you’d have to add a $i index inside the loop to get the second variable. But there’s a simpler way: $total = count($_POST[‘file_name’]); for($i = 0; $i < $total; $i++) { $file_name = $_POST[‘file_name’][$i]; $file = … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)