Grab values from the query string to fill in hidden fields in ninja forms [closed]

It looks like you can use the ninja_forms_display_init action to populate a field. To get the job ID from the URL you mentioned above you can use the $_GET array. Adapting the code from that documentation page, something like this should achieve what you’re looking for: function wpse_158000_populate_field($form_id) { global $ninja_forms_loading; $job_id_field = 3; //put … Read more

Insert Query not working in the form

I figured out my error in the query, Thank you all guys for responding, I just gave the piece of code <?php global $wpdb; $contactus_table = $wpdb->prefix.”contactus”; //error with the query $sql = “INSERT INTO $contactus_table (firstname, lastname, email, query, reg_date) VALUES (‘$firstName’, ‘$lastName’, ‘$email’, ‘$query’, CURRENT_TIMESTAMP)”; if($wpdb->query($sql)) { $BlogName = get_bloginfo(); echo $BlogName; } … Read more

admin_post equivalent for guest user?

If you look at admin-post.php, there is a check for wp_validate_auth_cookie() not whether the user is an administrator. So anyone with a valid authorization cookie will trigger the “admin_post_{$action}” hook. If the user doesn’t have a valid authorization cookie, then WP will trigger “admin_post_nopriv_{$action}”.

How dynamically change wp_mail behaviour, sending html or plain text based on conditions?

Here’s an (untested) PHPMailer example to check for e.g. the subject and the content type: function mailer_config( PHPMailer $mailer ) { if( ‘Subject #1’ === $mailer->Subject && ‘text/html’ !== $mailer->ContentType ) { $mailer->IsHTML( true ); } } other options would be to e.g. check the $mailer->From or $mailer->FromName, or some other conditions, depending on your … Read more

WordPress admin-ajax.php 400 bad request

Your full form code does contain a hidden input named action with the value send_form. However, you’re not sending it correctly, because of the the contentType part in your JS script, which submits the form data as a JSON payload, but note that the old admin-ajax.php endpoint doesn’t support JSON payload, hence $_REQUEST[‘action’] would be … Read more

File Upload from Frontend

Before Header: <?php $post_id = $post->ID; if ( isset( $_POST[‘html-upload’] ) && ! empty( $_FILES ) ) { require_once( ABSPATH . ‘wp-admin/includes/admin.php’ ); $id = media_handle_upload( ‘async-upload’, $post_id ); //post id of Client Files page unset( $_FILES ); if( is_wp_error( $id ) ) { $errors[‘upload_error’] = $id; $id = false; } if( $errors ) { … Read more

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