The URL field is currently only available in ACF5 Pro. A free version of ACF should be released this year. At least that was what the developer said.
This will be added in version 5.6 which is currently in Beta
Hiding the ACF admin will also hide those links https://www.advancedcustomfields.com/resources/how-to-hide-acf-menu-from-clients/
I do not think there is a way to hide that link/icon without also hiding the entire ACF admin.
Could you create a search like that with the aid of ACF? Yes. Is it something that will be easy to do? Likely not. You would need to build the entire search UI yourself and make it submit the search.
For an idea of what you’ll be getting into when getting the search results check the Dynamic $_GET parameters section of this page https://www.advancedcustomfields.com/resources/query-posts-custom-fields/ and this giuide https://www.advancedcustomfields.com/resources/creating-wp-archive-custom-field-filter/
As far as the UI, you’d be mostly on your own.
You can use an acf/load_field filter https://www.advancedcustomfields.com/resources/acf-load_field/. The choices of a checkbox field work the same as the choice for a select field https://www.advancedcustomfields.com/resources/dynamically-populate-a-select-fields-choices/.
You can either hard code the choices in the filter or you could create an options page that let’s you set them and then load the choices from there.
If what you have is in the right place, it should not only echo the value but it should also crash the page with an error “unable to send header information headers already sent at….”
You say that the post is being created and saved so I can’t say what the problem is. At this point I can’t see any reason that it would not be working.
When setting up the image field there is a setting for return value, you can set this to url, id or object/array. Information on how to work with each of these is in the image field documentation https://www.advancedcustomfields.com/resources/image/.
Removing some of the checkbox values will not alter posts that are already saved, but it will alter them if these posts are edited and updated.
You might want to look at using an acf/load_field filter https://www.advancedcustomfields.com/resources/acf-load_field/
In this filter you could alter the choices dynamically, only removing the ones you want to hide if they are not already selected for the post. The choices for a checkbox field work the same as the choices for a select field https://www.advancedcustomfields.com/resources/dynamically-populate-a-select-fields-choices/
you filter function needs to go in your function.php file. The template file is only loaded when showing the page so the function will not exist when it needs to be called.
Basically, your filter/function needs to exist before acf_form_head()
is called.
Yes, that would work.
Seeing the 3rd piece of code with it all together helps. When the page is being loaded and showing the form it is too late, posted data is not available when a page is being displayed. You must use an acf/save_post action https://www.advancedcustomfields.com/resources/acf-save_post/.
This is how form submissions work
1) You press submit
2) ACF saves that values (this is when $_POST) is available
3) ACF redirects back to the page and the page is reloaded ($_POST is not available when the page is being reloaded)
If $_POST was available on the page reload then hitting the browser reload button would resubmit the data.
// priority 1 or 20 depending on when you want this to run
// if you use 1 then you need to look in $_POST['acf']
// if you use 20 then you can use get_feild() and other acf functions
add_action('acf/save_post', 'my_acf_save_post_action', 1);
function my_acf_save_post_action($post_id) {
if (get_post_type($post_id) != 'db_test') {
// not our post type
return;
}
// code here to get acf values and do something with them
}
this does not tell me anything
I’m trying to echo the value when you press
submit
Please provide code that is specific to what you are attempting to do, whatever it is that you’re attempting to do. If this is an a filter that you are creating then the information on how you are adding the filter and the code of that filter would be helpful.
If you can’t get the post value then either it is not set or you’re trying to get it at the wrong time.
When are you trying to get this value to put into the other DB? When is this code run? Will need more information on when and how you are trying to do this.
what version of ACF are you using?
Is your field set to return the URL? or the object?
// ACF < 5.5.0
<img src="<?php the_field('image_field_name', $custom_term->taxonomy.'_'.$ $custom_term->term_id); ?>" alt="" class="img-responsive">
// ACF >= 5.5.0
<img src="<?php the_field('image_field_name', 'term_'.$custom_term->term_id); ?>" alt="" class="img-responsive">
See https://www.advancedcustomfields.com/resources/get-values-from-a-taxonomy-term/
If you are returning a image object/array instead of the url then see https://www.advancedcustomfields.com/resources/image/ for information on showing image fields.
This is not possible, or more accurately it is not built into ACF. You can get this result by adding your own custom JavaScript https://www.advancedcustomfields.com/resources/adding-custom-javascript-fields/. I don’t know exactly what you need to do, but the basics are that you need to add a change action to the taxonomy field, you should look for an example of getting values from Select2 fields. The see what the values are and then hide or show the fields you want to be conditional, you can do this by using that acf hidden-by-conditional-logic
class adding or removing this class from the fields you want to be conditional.
There are some solutions in this topic https://support.advancedcustomfields.com/forums/topic/conditional-logic-using-taxonomy-field/
This seems to give a solution http://idealienstudios.com/crazy-with-conditionals/
It looks like you may have a conflict issue. wysiwyg field delayed init does not effect the standard WP editor and setting delayed init on one fields does not effect other wysiwyg fields.
deactivate other plugin and maybe switch themes to see if you can figure out where the conflict is.
You need to query all of the locations posts, loop through them and get the values.
$args = array(
'post_type' => 'locations',
'posts_per_page' => -1
)
$query = new WP_Query($args);
$facebook_ids = array();
if ($query->have_posts()) {
while($query->have_post()) {
$query->the_post();
$facebook_ids[] = get_field('facebook_id');
}
wp_reset_postdata()
}
echo implode(',', $facebook_ids);
You use a have_rows()
loop https://www.advancedcustomfields.com/resources/have_rows/
Is the code you posted the exact code you’re using? If it is then you have a typo in your field name
<?php
$Firstname = $_POST['acf']['field_5968834df2ac1'];
echo 'data' . $Firsname; // this is different than the line above.
?>
When are you attempting to get these values and save them? Is it in an acf/save_post action? https://www.advancedcustomfields.com/resources/acf-save_post/
If you’re having this issue please submit a new support ticket here https://support.advancedcustomfields.com/new-ticket/
I cannot recreate your issue. I created a CPT and any user type that can edit the CPT can see the custom fields I add to it. You’re issue has to be something to do with something in another plugin or your theme.
You need to figure out what you have that’s causing the issue by deactivating other plugins and narrow it down.
As far as your other questions, I don’t know how to do any of those things.
This is a very old topic. The page I linked to above appears to be no longer available. There is some information on querying by repeater fields here https://www.advancedcustomfields.com/resources/query-posts-custom-fields/
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.