Maybe a search plugin will work like facetwp or Search & Filter
I have used FacetWP with success it is compatible with ACF and many other plugins.
Cool Find Paul,
But maybe not everyone is to confident coding. There is a plugin FacetWP which is easy to configure and works well with Advanced Custom Fields.
I have used Facetwp can configure the fields and taxonomies to search on. Facetwp is also designed to work with ACF
This wordpress plugin will do the trick I thing
I finally managed to solve this problem, with adding some javascript to the head. I added the following code in my functions.php
function my_acf_admin_head()
{
?>
<script type="text/javascript">
jQuery(function($){
$(document).on('submit', '#post', function(){
$('.acf-error-message').remove();
});
})(jQuery);
</script>
<?php
}
add_action('acf/input/admin_head', 'my_acf_admin_head');
On submitting the form it removes all classes with “acf-error-message”
I updated the code from the first poster. You can’t check for is_admin, because it returns true (Ajax call is made to admin). See Documentation
https://codex.wordpress.org/Function_Reference/is_admin
//Custom redirected after creating a post
function custom_redirect_function_name($post_id) {
$redirect = get_the_permalink($post_id);
wp_redirect($redirect);
exit;
}
add_action('acf/save_post', 'custom_redirect_function_name', 20);
$redirect can be anything you want in my case it is as follow’s
$redirect="/thank-you/?listing_id=$post_id"
I wanted an url like this to process some further actions based on user choice (option to upgrade to different levels)
Have a look at Facetwp
I think I narrowed it further down. I think it is somehow some javascript which does not remove the error message from a field with custom validation.
If I added this in the beginning of my code in the validation function
if (($key = array_search($input, $GLOBALS['acf_validation_errors'])) !== false) {
unset($GLOBALS['acf_validation_errors'][$key]);
}
The text in the message dissapears, but the red error bar still stays
Some more information. When making the field required in the field settings. Then the message will disappear after the first validation fails, but after you corrected it and it passes validation again, the error message will be cleared. But I don’t want all fields with custom validation to be required.
Did some more testing. Field gets validated again, but message does not dissapear. Looks like some javascript on the front end does not clear the error message.
I would like to see that post_id gets added to the return url.
If I for example want to redirect them to a thank you page where I want to do additional with the added post I need the post_id
So i would like to have a a url like http://samplesite.com/thankyou/?id=###
For anybody who is interested. made a simple tag field for ACF on the frontend, in which you can add taxonomies as required.
You can find it here. It is very simple but it works. It will display a field where you can enter comma separated values, which then get saved or updated to your selected taxonomy (tags) (non hierarchical).
https://github.com/kolhoffmmm/acf_tags
I modified a a plugin which I forked and corrected.
You can find it here
https://bitbucket.org/kolhoffmmm/acf-edit-title-content
+1 this is a required feature, tags are supposed to be added, as it is a non hierarchical taxonomy.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.