Code

Discussion on ACF Front Form with Visual Composer and WPBackery Integration

Discussion on ACF Front Form with Visual Composer and WPBackery Integration

Cart 54 sales

armediacgcom supports this item

Supported

This author's response time can be up to 5 business days.

34 comments found.

Hi,

You are plugin developer and more experience than us. Which is better for our hosting resources, display edit forms under posts or with edit link to another page for post edit… Sorry maybe i’m always asking but i have to plan my each step for my projects …

Thanks

Hi, Thank you for your compliment but i’m just new wp plugins developper, can you please send me again your wp login so i can see whet i can do ?

Thanks

Hi, thanks your help. i will complete web desgin with in a week after i wrote what i need… Thanks again. Note: For beginner wp developer, you are great :)

Thank you :)

Hey! Cool plugin but let’s say I create a custom post type template with visual composer and a visitor submits the form, how will the elements that the visitor filled can be assigned the design I made in the template?

Usually, the form fits the template you use, it uses default WP classes, if you want to customize, then just add css to the form

Hi,

I was reading your documents but i could not find about user profile form. I created acf field group (User Form , Add/Edit) but how do use this field with your acf form in visual composer? There new_post or blank option for Post ID section.

Can u help please… Thanks.

Sorry but i’m not sure to understand, can you please give concrete example ?

Ah sorry for bad english… I mean that, talking about multiselect field. Such as i have country multiselect (based country taxonomy) field, and anyone can add maximum 3 terms using form (for publish post or edit) . I dont know, maybe you can add features on your VC form. Because you form also showing fields and for some multiselect fields we can define on form, or if this is hard, maybe we can define global (all multiselect terms maximum add) with your plugin setting page

Hi,

If you want to limit the acf field, then this link will help you. It sets a limit number of the select

Since it’s ACF feature, i can’t include this feature into my plugin (at least for the moment)

:)

Hi,

Pre sales question : I have KLEO theme and VC is coming with my theme. Also i purchased this plugin last day https://codecanyon.net/item/custom-page-templates-new-way-of-creating-custom-templates-in-wordpress/20133287 and this plugin include ACF PRO (i did not buy PRO). So i have 2 question, 1 – I did not install and activated ACF Pro but its working with this plugin, does it make any conflict or is ur plugin work with this ACF Pro 2 – Ok, anyone use your form on frontend but the biggest problem always edit on frontend. Do you have this feature? Sorry bad english :)

Thanks

Hi, Here some quick answers :
  1. If you are familar with WP developpement, You can hook your page to check if post_author equals current_user, the print the acf_front_form shortcode with do_shortcode
  2. the form id is just the value of the id attribute of the form tag in the generated html : <form id=”acf-form2”>
  3. I mean a form where you set post IDs, then when the user click on the button, the ID of the post is then “posted” to the page where you use the acf_front_form, this ID you can catch is from $_POST and set it into acf_front_form shortcode, Here a basic example
  4. I think that you are right, i ont know exactly what you are trying to achieve but it’s ok to put the shortcode into single.php, but i suggest to manage it with user roles an post ids
  5. If you didn’t added the code, then you know that you ont need to enable them :) If any other plugin do it, then i think they should notice that in theire documentation, FYI those functions are part of ACF, if a plugin do not use ACF then it will not add those hooks :)
I hope that i’ve answered to your questions, as a good news for you, Questions 1 an 3 are planned as new features in the next release, which is coming in next few days (about 20)

All your rating and reviews are welcome :)

Hi,

Before reply your answers i would like to say thanks your customer services because we non develeoper customer always facing some problems and always trying to find answer but you are replying all questions very fast. Thanks. Ok

When you say new features in the next release above , i want to suggest some features. A – Form use limit publish to post. Maybe per role or anyone can use this form everyday 3 times. So limit will decrease spam publish post because in my project all members also author to publish post. B – Edit form: If anyone publish any post, how many times can edit? C – Edit, Delete and Unpublish (add to archive) buttons element for visual composer.

1 – Author = Current User : Before purchase this pluging, i was try to create form manually and i found this code some forums and added to single.php so only post author was see form. <?php

if ( is_user_logged_in() || current_user_can(‘publish_posts’) ) { // Execute code if user is logged in acf_form_head(); wp_deregister_style( ‘wp-admin’ ); } get_header();

But i could not use now. If possible can you help about this topic. How can i do for wp default post and cpt post?

3 – Still i cant understand edit. How do add edit link any wp post and cpt post ? When i add edit link, link will go to form? Now, i just add edit form in single.php so authors will edit same page. If possible can write edit link code and if possible can you create shortcode element for visual composer?

Note: Publish create form is ok for me. i understand wery well. And i can add any wp PAGE, but edit page is still problem for me :) so sorry… I think more documan for edit. I know u will add features in next but i need now :)

Thanks

Hi, First, you dont need to hook the acf_form_head function because it’s already hooked see here To define wp default posts or CPT, just select the post type you want under “Post” tab, in the “Post Type” list (see here). The Edit works in two cases : A. When you dont set the “post_id” value, then the edit will work for the actual Page OR Post where the acf front form is (if you put ACF Front Form into a post it will edit the post, if you put it into Contact page it will edit the Contact page)

B. When you set/define the ID, it will edit the post (any type) of that ID (if you set id = 1 an put ACF Front Form in Contact page, it will eit the Hello World post (id=1))

Now, to get and post the I with PHP (use a form or a link), i’ll suggest you to rea about the $_GET and $_POST variables, how they work and how to use them.

For edit i’ll try to help you ASAP i get some time

Mourad

Hi there,

We are building a listing directory website. We use different repeater fields for different listing types. We have back end editing and fields are inserted to front end by modifying php files.

We would like to add possibility for our members to edit repeater fields content form front end. There is a listing edit template page for editing listings page – this is editable via visual composer. We would like to use your plugin to add option of editing data in the ACF fields, set by a taxonomy – meaning, if client is editing listing which is by category “taxonomy 1”, there should be only editing option for ACF repeater field for that taxonomy. If listing belongs to both “taxonomy 1” and “taxonomy 2” there should be editing options for ACF fields for both taxonomies, and so on.

Is this possible to achieve by using your plugin?

Let me know if i can help with your project

Hi there :) Thank you for your reply. I’ll send you the links via e-mail just to be sure. All the best.

Hi, i’ve received your email and i’ll check it ASAP i get time this evening

I do not have an email address to send to. When I use the email interface here, it will be shown in this item’s comments page. I tried replying to the do-no-reply email I got and that bounced. I really don’t want to publicly post admin user credentials on the internet.

Got it, thanks!

Hi, I’ve done i sample page “ACF Front Form Sample — Draft” and it’s working fine. In your case, you didn’t selected which Field Groups to display and you have set ACF to a specific Page, use Post Types instead. I’ve sent you email with more explanation

Let me know if all is ok

I cannot get this to work at all. The plugin was recommended to me by ACF. All I get is a submit button. :(((((((((((

Well, if you give me access to your Wordpress website, i’ll check what’s wrong and try to fix it..

Cool! Thanks! I can’t mark this private so let me know how to tell you the username and password.

Send me new admin credentials by email, then delete the account aften we are done

I just realized the domain I sent you for the ftp. Www. For the website

no problem, i dont need it anyways, can edit with wordpress editor

I created a temporary wordpress site (see separate email for login information) and set up a custom field to work with the standard post. I updated the functions.php file to add the code called out in the link you sent me. The code.is listed below. I am able us specify a specific Post ID. It doesn’t pull the custom field information into the form, but it does save the custom field information back to the post when I enter it on the form and save the form. What do I need to do to pull custom field information into the form for a specific Post ID?

function my_pre_save_post( $post_id ) {

// check if this is to be a new post
if( $post_id != 'new' ) {
return $post_id;
}
// Create a new post
$post = array(
    'post_status'  => 'draft' ,
    'post_title'  => 'A title, maybe a $_POST variable' ,
    'post_type'  => 'post' ,
);
// insert the post
$post_id = wp_insert_post( $post );
// return the new ID
return $post_id;

}

add_filter(‘acf/pre_save_post’ , ‘my_pre_save_post’, 10, 1 );

I made a small changes into functions.php too, check it

function my_pre_save_post( $post_id ) {

    // check if this is to be a new post
    if( $post_id != 'new' ) {

        return $post_id;

    }

    $post_title = 'draft';

    if( isset($_POST['acf']['_post_title']) ) {

        $post_title = acf_extract_var($_POST['acf'], '_post_title');

    }

    // Create a new post
    $post = array(
        'post_status'  => 'draft' ,
        'post_title'    => $post_title,
        'post_type'  => 'post' ,
        'post_content'    => '[acf_front_form post_title="Yes" field_groups="11"]'
    );  

    // insert the post
    $post_id = wp_insert_post( $post ); 

    // return the new ID
    return $post_id;

}
Please leave a good review if you enjoyed :)

I made the changes to my production site and everything works great. As you mentioned before, it only works with new posts that have been created after installing ACF Front Form. When I try using the form with old posts, it pulls the data in fine, but hangs when trying to save the form. Not a big deal for me because I’m still building my site so all data is just demo data anyways. I do have a couple questions. 1. One of the lines of code added to the functions.php file was

'post_content'    => '[acf_front_form post_title="Yes" field_groups="11"]'
Do you have you add this line for every custom field groups used in all forms?

2. Is it possible to use ACF Front Form to view/edit fields that are part of the regular post (other than Title and Content)? Or does it just work with fields defined by Advanced Custom Fields?

Not sure if i understand but i’ll try to answer :
  1. That line adds the form for a new post on which Post ID = “new”. To do the same for a different kind of form/post, set Post ID to another value (for example “new_1”, “new_book” and in the hook you can check which tule to appli with if…else block. Note that you can add as many field groups/fields into the shortcode if you want to use more than one form for a post
    field_groups="11,12,13"
  2. No, ACF Front Form uses
    acf_form()
    function which is an ACF feature, this feature creates a form for ACF fields and optional Title and Content of the post. To edit other post fields you can do it on acf/pre_save_post filter

great job. good luck with sales

Thank you my friend !

Here is your login https://www.oxfordlp.com/wp-admin/ L: armedia_am P: armedia_am http://www.oxfordlp.com/register/

Ill delete once you say you got it

Done, Try it !

The functions.php file can be edited from Appearence > Editor > functions.php

I’ll give you more details if you join me on Skype…

Hi, Is all working well ? let me know if you need more help

Would love to have a demo or preview to see the plugin in Action. But it´s a great Thing and I added it to watchlist.

Maybe, it´s an idea for your to develop a ACF plugin, that can build front end layouts too :)

Yes I saw that in your Video.

But it´s not the same as letting the user Chose if he wants to write a Review, Story or something else.

ACF already has select fields for post types. Maybe you can use them

I’ve submitted new features including the one you wanted… and more are coming see http://acf-front-form-docs.readthedocs.io/en/release--1.1/src/add-form.html#using-visual-composer

Great Work, Congratulations GLWS :)

Thank you a lot !

I like your code, I was wondering if they submitted certain number for example “OLP-9898-3447895033” it would go another page after they submit?

No, just copy/past, change “my_field” with your field name, and all should work :)

You need to add the code into

wp-content/themes/<your_theme>/functions.php
If the file is not there, create it and dont forget <?php opening tag

Give me the login join me on Skype “armedia_am”

by
by
by
by
by
by

Tell us what you think!

We'd like to ask you a few questions to help improve CodeCanyon.

Sure, take me to the survey