Nonce fail after second submit attempt

Not 100 % positive but my understanding is that a Nonce expire as soon as you use it. It can only be used for one transaction. So it seems to be logic that it expire after the first call. You should probably return a new one with the response of your first validated request and … Read more

plugins_loaded action is not working properly

plugins_loaded is going to load this form much too early, even if you weren’t getting errors. The form is loading before the opening <html tags. You need to select better hooks for this– admin_notices maybe, but it is hard to tell exactly what you want. Second, you need to separate your handler: function process_wpse_194468() { … Read more

Accessing values entered via form – try again

You are right the action part is the directory to the execution script file. You can not use the static directory path like that, it should be used with get_home_path(); like $path = get_home_path(); then action = ‘<?php echo $path.”wp-includes/tests-form.php” ?>’; More: https://codex.wordpress.org/Function_Reference/get_home_path

Can someone help me edit the code for limiting image dimensions

Add new plugin maybe considered as uploading file. Check if the file uploaded is an image or not before handling if(@!is_array(getimagesize($mediapath))){ $image = true; } else { $image = false; } Thanks to: https://stackoverflow.com/questions/15408125/php-check-if-file-is-an-image So, modify your code to function mdu_validate_image_size( $file ) { $image = getimagesize($file[‘tmp_name’]); if(@!is_array(getimagesize($image))){//check if file is an image //do stuff … Read more

Page returning ID from array, how to return the correct values for post in acf wordpress

I played with the code for a bit longer and managed to get it working. Answer below add_filter( ‘gform_pre_render’, ‘freetrial_studios’ ); add_filter( ‘gform_pre_validation’, ‘freetrial_studios’ ); add_filter( ‘gform_pre_submission_filter’, ‘freetrial_studios’ ); add_filter( ‘gform_admin_pre_render’, ‘freetrial_studios’ ); function freetrial_studios( $form ) { foreach ( $form[‘fields’] as &$field ) { if ( $field->type != ‘select’ || strpos( $field->cssClass, ‘studio-list’ ) … Read more