Issue with dynamically populating address fields with Gravity Forms

The following code fixed my issue: if ( $field->type == ‘address’ && is_array( $field->inputs ) ) { foreach ( $field->inputs as &$input ) { $input_name = rgar( $input, ‘name’ ); if ( $input_name && in_array( $input_name, $address_fields ) ) { $current_value = get_post_meta( $post_id_cid, $input_name, true ); if ( $current_value ) { $input[‘defaultValue’] = $current_value; … Read more

Gravity Forms with Advanced Post Creation Add-On not updating ACF fields on custom taxonomy

To resolve the issue with Gravity Forms and the Advanced Post Creation Add-On not updating ACF fields on a custom taxonomy, you can try adding the following code snippet to your WordPress theme’s functions.php file: add_action( ‘gform_post_create_post’, ‘update_custom_taxonomy_acf_fields’, 10, 3 ); function update_custom_taxonomy_acf_fields( $post_id, $form, $entry ) { // Check if the custom taxonomy term … Read more

How to overwrite image if it already exists – WordPress, Gravity form

These lines of code and can help you to overwrite image $attachment_id = get_post_thumbnail_id($post_id); wp_delete_attachment($attachment_id, true); if(isset($file) && !empty($file) ){ $upload_overrides = array(‘test_form’=> false); $movefile = wp_handle_upload($file, $upload_overrides); $filename = basename( $movefile[‘url’] ); $wp_filetype = wp_check_filetype($filename, null ); $attachment = array( ‘guid’ => $wp_upload_dir[‘url’] . “https://wordpress.stackexchange.com/” . $filename, ‘post_mime_type’ => $wp_filetype[‘type’], ‘post_title’ => preg_replace(‘/\.[^.]+$/’, ”, … Read more

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