How to change image’s author via a function when using GravityForms uploader? [closed]

add_action(“gform_user_registered”, “image_author”, 10, 4); function image_author($user_id, $config, $entry, $user_pass) { $post_id = $entry[“post_id”]; $args = array( ‘post_parent’ => $post_id, ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’ ); $attachments = get_posts($args); if($attachments) : foreach ($attachments as $attachment) : setup_postdata($attachment); $the_post = array(); $the_post[‘ID’] = $attachment->ID; $the_post[‘post_author’] = $user_id; wp_update_post( $the_post ); endforeach; endif; }

need correction with a snippet in functions.php [closed]

If it is a dropdown and you want to populate it with options may be use this filter add_filter(“gform_predefined_choices”, “add_predefined_choice”); function add_predefined_choice($choices){ $choices[“My New Choice”] = array(“Choice 1”, “Choice 2”, “Choice 3”); return $choices; } http://www.gravityhelp.com/documentation/page/Gform_predefined_choices gform_field_value_selection filter is for default value. Give a look here http://www.gravityhelp.com/documentation/page/Developer_Docs See if this works.. add_filter(“gform_field_value_selection”, “populate_selection”); function populate_selection … Read more

How to add external remote JS source to Gravity Forms?

I think you’re looking for gform_enqueue_scripts which is simply a Gravity Forms specific version of the wp_enqueue_scripts hook. Either hook uses the wp_enqueue_script() function. That function can take a local script—usually using get_template_directory_uri() (theme), get_stylesheet_directory_uri() child theme), or plugins_url() (plugin) to reference the file location—or an external location like what you’re trying to do. You’d … Read more

Gravity Forms | Form Object is NULL [closed]

By default, the add_action function is only going to pass 1 parameter, but you can define how many do you have / need $accepted_args (int) (optional) The number of arguments the hooked function accepts. In WordPress 1.5.1+, hooked functions can take extra arguments that are set when the matching do_action() or apply_filters() call is run. … Read more

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