Hello.
I want to create a CF7 custom field for a custom post type called “Hotel”.
Each Hotel should have its own contact form.
Does this require a coding setup?
I am assuming that every time I create a new Hotel, I will add the appropriate CF7 shortcode to the Hotel’s contact form custom field.
Is this correct?
Hi,
Could you please tell me if your plugin is compatable with Oxygen Builder and the laterst version of ACF?
I don’t see anything returned in the builde ror the front end.
Thanks
TK
I have a headless cms project utilising the ACF plugin. When implementing ACF Field For Contact Form 7, the wordpress rest routes are broken (entering into url shows critial wordpress error). This happens once the Contact Form 7 field is utilised in a set of custom fields.
Not sure if this is a bug or if this field is just not compatible with ACF to Rest API plugin.
Any help or clarification would be great.
ACF Pro Version 5.12
ACF to REST API Version 3.3.3
ACF Field For Contact Form 7 Version 1.6
WordPress 5.9.3
Hi,
first off: thanks for the plugin! So practical ??
Your plugin works just as expected when echoed over PHP. But, in combination with ACF to REST API (to expose it over WordPress’ REST API), the action attribute of the form
changes from action="[slug]#[form_id]"
to action="[api_endpoint]#[form_id]"
which leads to errors.
I am not 100% sure the problem is on your plugin, but could you please check on it?
Thanks a lot.
]]>I’m trying to use the cf7 field in a template to show the contact form, but then in some backend code I also need the form ID.
The docs show how to enable the object mode but not how to remove it again.
I’ve tried this but it doesn’t work:
function get_voippdf_form_id() {
function get_acf_cf7_object () {
return true;
}
add_filter('acf_cf7_object', 'get_acf_cf7_object', 10);
$form = get_field('voippdf_contact_form', 'option');
remove_filter('acf_cf7_object', 'get_acf_cf7_object', 10);
return $form->id;
}
Once the add_filter
has been called in the function above, then my template in footer.php
which also calls get_field
, returns the object instead of the form and breaks the page.
Is there some way to use both the form and the object in a single page load?
]]>Need help for this
]]>Hi,
I bought Pro version but no default selection possible?
I need a standard value for all sites and only if the admin select another field it should be used.
I upload the pro version but nothing changed?
Florian
]]>Hello,
Can I show contact form 7 on elementor pro theme ? e.g. using shortcode? this applies to posts, I can display ACF elements as Dynamic Tags. Can I display the CF7 field as Dynamic Tags?
]]>Hello,
Can this plugin be used to make a drop down list ?
I would like to create a list of items with an image for each item.
Then the form filler can select the item they like and see the image.
Thanks
]]>Here is my original CF7 short-code
<?php echo do_shortcode('[contact-form-7 id="979" title="Contact form" html_id="contact-form" html_class="form-validate form-horizontal"]'); ?>
Since there are more than one form in my website, therefore I choose to use this plugin, however the class and id will be lose, is it able to insert the html_id and html_class via this plugin?
]]>I think it is a bug in acf-cf7-v5.php when it checks inside $forms if $field[value] is not an array, but search with in_array() function.
It give me a lot of Warnings when I debug WordPress.
I point the code bellow.
Is it?
// Display all contact form 7 forms
$forms = get_posts(array('post_type' => 'wpcf7_contact_form', 'orderby' => 'id', 'order' => 'ASC', 'posts_per_page' => -1, 'numberposts' => -1));
if($forms){
foreach($forms as $k => $form){
$key = $form->ID;
$value = $form->post_title;
$selected = '';
// Mark form as selected as required
if(is_array($field['value'])){
// If the value is an array (multiple select), loop through values and check if it is selected
if(in_array($key, $field['value'])){
$selected = 'selected="selected"';
}
//Disable form selection as required
if(in_array(($k+1), $field['disable'])){
$selected = 'disabled="disabled"';
}
}else{
// If not a multiple select, just check normaly
if($key == $field['value']){
$selected = 'selected="selected"';
//THE BUG? }
if(in_array(($k+1), $field['disable'])){
$selected = 'disabled="disabled"';</strong>
}
}
echo '<option value="'.$key.'" '.$selected.'>'.$value.'</option>';
}
}
]]>
According to FAQ section to return form object you need add filter
add_filter( 'get_acf_cf7_object', 'get_acf_cf7_object' );
But it didn’t work. Actual filter is “acf_cf7_object“
Hello,
I’ve just installed this extension, and despite it working well there’s a little bug when you’re loading the field into a variable.
Because instead of placing the field into a variable, the field gets displayed immediately.
It doesn’t matter if the field is inside a group or anything, as soon as it’s called it just forces itself onto the front-end.
For example:
Here I’m just preparing a few values to be thrown into the content, with a default fallback. The “cta_form_block” is a group, and has the form in it. As soon as the group is stored into the variable it’s forcing the form to be displayed.
//Get the page content
$page_form_content = get_field('cta_form_block'); //Here it's already being displayed
//Setup new empty fields
$form_title = '';
$form_description = '';
$form_form = '';
//Fill the content
if( $page_form_content ): //Enter group
$form_title = $page_form_content['title'];
$form_description = $page_form_content['description'];
$form_form = $page_form_content['form'];
else:
$form_title = $default_title;
$form_description = $default_description;
$form_form = $default_form;
endif;
?>
I then figured I might try to make it it’s own field, so I gave it it’s own field. Like so:
$page_form_form = get_field('cta_form_form');
That’ll also immediately display the form.
So now I’ll just call the field directly in the content, while I’m generally trying to keep the logic and content seperated as much as possible.
It’s not a dramatic issue, but I thought that it’d be good for you guys to know about this.
]]>