
I am not sure what you mean by “It does not work” is the Repeater field not saving values? If this is the case, it may be related to the field_name length.
ACF uses the field’s name to save a value into the database. When saving sub fields, the ‘save name’ is generated by the ancestors names + the row index and can become quite long. It is possible that the length of this ‘save name’ can become too long for the wp_options table, and WP will not be able to save the value at all.
You can solve this by reducing the field name length.
If the issue is to do with the field not saving, you can make the following changes to the php.ini file:
max_input_vars = 3000
suhosin.get.max_vars = 3000
suhosin.post.max_vars = 3000
suhosin.request.max_vars = 3000

Hi @maliakmal
The Google Map Field relies entirely on the google map API and thus it is recommended to consult the Google team for more APIs and for further tutorials.
It is however important to note that not all browsers support geolocation, it is a device-specific API; some browser/devices support it, while others do not (or cannot).
You can use the W3C navigator.geolocation property to get the location using the following code:
var initialLocation;
var siberia = new google.maps.LatLng(60, 105);
var newyork = new google.maps.LatLng(40.69847032728747, -73.9514422416687);
var browserSupportFlag = new Boolean();
function initialize() {
var myOptions = {
zoom: 6,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map-canvas"), myOptions);
// Try W3C Geolocation (Preferred)
if(navigator.geolocation) {
browserSupportFlag = true;
navigator.geolocation.getCurrentPosition(function(position) {
initialLocation = new google.maps.LatLng(position.coords.latitude,position.coords.longitude);
map.setCenter(initialLocation);
}, function() {
handleNoGeolocation(browserSupportFlag);
});
}
// Browser doesn't support Geolocation
else {
browserSupportFlag = false;
handleNoGeolocation(browserSupportFlag);
}
function handleNoGeolocation(errorFlag) {
if (errorFlag == true) {
alert("Geolocation service failed.");
initialLocation = newyork;
} else {
alert("Your browser doesn't support geolocation. We've placed you in Siberia.");
initialLocation = siberia;
}
map.setCenter(initialLocation);
}
}

Hi @jimrapt
We have not had similar reports of this, therefore this is less likely to be a bug.
It seems something might be interfering with the database queries and thus the wrong results, you need to investigate whether this issue could be stemming from your theme by deactivating it and switching to one of the stock Wp themes.
If this fails to solve the issue you might need to do a fresh install of WordPress.

If this is a bug it would be a WP bug. But looking at your query there are few things that stand out. One is that you have a meta_query that I don’t think you need and the second is that in that meta_query you are telling that the meta field is a date and I’m pretty sure that WP expects this to be in YYYY-MM-DD format, so your dates may be being read wrong. The last thing is that you are using orderby => meta_value_number.
Try this for your query:
$args = array(
'post_type' => 'project',
'meta_key' => 'project_date',
'orderby'=> 'meta_value',
'order' => 'DESC',
'paged' => $paged
);
$wp_query = new WP_Query($args);
get_template_part('templates/loop', 'project');

Hi guys
Just want to let you know I have added in some new filters for the user field and will be included in the next version of ACF PRO:
result
– used to modify the text which is displayed for each user result
$result = apply_filters("acf/fields/user/result", $result, $user, $field, $post_id);
$result = apply_filters("acf/fields/user/result/name={$field['_name']}", $result, $user, $field, $post_id);
$result = apply_filters("acf/fields/user/result/key={$field['key']}", $result, $user, $field, $post_id);
search_columns
– used to modify the columns which are searched
$columns = apply_filters("acf/fields/user/search_columns", $columns, $search, $WP_User_Query, $field);
$columns = apply_filters("acf/fields/user/search_columns/name={$field['_name']}", $columns, $search, $WP_User_Query, $field);
$columns = apply_filters("acf/fields/user/search_columns/key={$field['key']}", $columns, $search, $WP_User_Query, $field);
Hopefully these are self explanatory. I’ll add documentation soon
Thanks
E

The relationship field => author is stored in the database as a post ID. (if it is a post object field, it’s an array of post IDs if it’s a relationship.)
On top of that, if I understand you correctly, you are trying to order your publication posts by the title of your author posts. So you’re trying to order the posts by the title of other posts. This is not going to be possible using just a WP query.
You’re going to need to get all the authors in the order you want them. Then you’re going to need to get all the publications and then you’re going to have to figure out how to order the publications by the authors. While possible, that’s complicated just to think about.
You could create an acf/save_post action and in that action you could get the selected author, get the authors name and store the name in another custom field using update_post_meta(). I would hide this field by adding an _ to the beginning like _author_name The you could sort your publications by this hidden custom field. This would be a lot less work then trying to sort post by the titles of related posts.

First sn explanation of why I say to use pre_get_posts and to put the in functions.php.
If you have a custom post type, and you create a template for the archive of that post type, then you do not need to do a query to get the posts of the post type, WP does that already.
Example: I create a post type called “product” and I create 2 template files “single-product.php” and “archive-product.php”. WordPress automatically does the queries needed to get the product posts when these templates are use and these templates will be used whenever product posts are being requested. WP will run whether you want it to run or not so you may as well use it. The pre_get_posts hook allows you to alter what WP gets in this default query.
Doing this any other way doubles the amount of queries and work that WP needs to do to load a page.
If you still want to do a query then you can add the meta query I gave you to the query you are doing.
$args = array(
'post_type' => 'my-post-type',
'posts_per_page' => 6,
'meta_query' => array(
array(
'key' => 'my_field',
'value' => '1'
),
);
$query = new WP_Query($args);
This – from the ACF docs – is the kind of thing I’m trying to do, but this code isn’t working:
$posts = get_posts(array(
'meta_query' => array(
array(
'key' => 'field_name', // name of custom field
'value' => '"red"', // matches exaclty "red", not just red. This prevents a match for "acquired"
'compare' => 'LIKE'
)
)
));
if( $posts )
{
//...
}
Your initial assumption is correct, I need it to filter out the posts that are returned so needs to be in the query. Not for the main loop, but for a Custom Post Type loop.
But it’s a checkbox, so it can have one or multiple items. Though I am checking for just one item per query (this will be used a number of times depending on page) so it might still work, I’ll give it a go.
Cheers.

This question sounds like it’s related directly to this other question http://support.advancedcustomfields.com/forums/topic/wp-loop-via-checkbox-value/
The pagination function will work without doing a new query for your custom post type. I wouldn’t follow that post.
The correct way to do this is to create a template for your custom post type archive following the WP template hierarchy and then do a pre_get_posts action like I showed in that question.
Previous and next post link function are documented here https://codex.wordpress.org/Function_Reference/previous_posts_link and here https://codex.wordpress.org/Template_Tags/next_posts_link

You have a checkbox field, by this I’m assuming that this is a True/False field because you say "if it is true then that item is included in the loop"
When you say that you want it included in the loop, here I’m assuming that you mean included in the posts that are returned by WP_Query, either the main query or a custom query.
Is it a custom query or the main WP query that you are looking to alter to only include posts that are marked as true? My answer below is assuming that you mean the main WP query because you did not mention a custom query and "if it is true then that item is included in the loop"
Let me know if I have any of this wrong.
If my assumptions are correct then you need to add a pre_get_posts filter in WP.
To your functions.php file add something like:
// change "my_post_type" to the name of your post type
// change "my_field" to the name of your ACF field
function my_post_type_pre_get_posts($query) {
if (is_admin() || !$query->is_main_query()) {
return;
}
if ($query->query_vars['post_type'] == 'my_post_type') {
$meta_query = array(
array(
'key' => 'my_field',
'value' => '1' // this is the value that ACF saves
// for a true value in a true/false field
)
);
$query->set('meta_query', $meta_query);
}
}
add_action('pre_get_posts', 'my_post_type_pre_get_posts');

I don’t think you’ll find a specific tutorial that will cover everything you need, but yes, this is possible.
Here is a quick overview of what needs to be done.
Thanks
So far I have been using this format:
field_{field_group_name}_{field_name}
Everything has been working fine as long as I use a unique group name and label name. Which you need to do anyways.
I think there should be an option to leave it blank and it will use this format.
I did have issues with older versions of ACF with the field id, but with 4.4.1 we don’t have any issues now.

I must have marked this at one time because I was interested in the topic and I got and email about a reply.
Don’t know if this will help you at all but you do not need to use the field keys that ACF generates, but you do need some type of field keys. Using field keys can also be necessary in some filters and actions.
This is the way that ACF keeps track of everything in the database and gives everything a unique value. It is very easy to create 2 field groups that both have the same field name, but the keys need to be unique.
I build plugins that use ACF all the time and put the code for generating field keys into PHP all the time, then I alter the field keys. From my experience you can make them anything as long as you follow a few rules.
1) they all begin with “field_”
2) they are 19 characters long (that give you 13 characters), I’m not too sure about this but better safe than sorry.
3) the part after “field_” has only numbers and letters. I’ve run into issues in the past where I included a second underscore.
What I do is I use a unique prefix, lets say I decide to use “abcd” for a particular plugin the I create field keys like
field_abcd000000001
field_abcd000000002
field_abcd000000003
etc.

The last rule
OR
Post Type is not equal to Event
That basically overrides all the other rules. If the post type is not event then it will show the group. Since this is for pages, you don’t need that last rule.
Also, this rule
OR
Page Type is equal to Top Level Page no parent
should be combined with the other rules as an AND unless you want it to appear on all top level pages regardless of what template they use.

Hi @madivad,
I must say your implementation is quite complex but if you are not willing to use a plugin to simplify things, another option would be to use the acf/input/admin_enqueue_scripts action to register the custom styles.
This action is limited to pages where field inputs are generated.
You can have a look through the following link: http://www.advancedcustomfields.com/resources/acfinputadmin_enqueue_scripts/

If you mean the standard WP post title field. What you need to do is create another field for people to enter the title and then convert that into a title in an acf_pre_save_post filter. There is an example of doing this in this question http://support.advancedcustomfields.com/forums/topic/radio-field-conditional-in-afc_form/ and you can read more about it here http://www.advancedcustomfields.com/resources/acf-pre_save_post/

Hi @fatnjazzy
Thanks for the question but I am not sure I understand it correctly.
I would however like to point out that field groups registered via code are not visible through the ‘Field Group Edit Page’ maybe that is why you could be wondering if they have been saved in the database.

Hi @dcooney
There was a bug on version 5.1.5 that was affecting the loading of select2 I believe this is related.
The bug was fixed on the next update 5.1.6.
You can also use the acf/input/admin_enqueue_scripts action to register / deregister / enqueue / dequeue styles
You can check out more info on this action here: http://www.advancedcustomfields.com/resources/acfinputadmin_enqueue_scripts/

Sorry für die späte antwort:
bin ziemlich stark mit Arbeit ausgelastet, daher fehlt mir auch die zeit genauer auf dein Problem einzugehen.
Die Hauptfrage ist: was passiert wenn 2.2.6 ausgewält ist?
solange es nur auswirkungen auf 2.2.x hat ist es nicht sehr schwer.
wenn es jedoch auswirkungen auf ausgaben im repeater darüber hat wird es kompliziert.
because you use a checkbox inside a repeater it use sub_field.
use this code inside your 2.2 repeater loop:
//multi option checkbox
if( in_array( 'fonts', get_sub_field('abteilung') ) )
{
//...
echo "fonts is checked";
}
//single option checkbox
if(get_sub_field('abteilung') == 'fonts')
{
//...
echo "fonts is checked";
}
that should work and i hope that it help you to build what you like
je nach dem was du genau vorhast, wäre es evtl. sinvoller das ganze anders aufzubauen. um das zu beurteilen fehlt mir jedoch die zeit (zudem wären zusätliche bzw. genauere angaben nötig)

Hi @noma,
Thank you for the question.
Is this happening on a local or live server?
Is it possible to create a new user for me so that I can take a look? Please remember to mark your response as private when sending the credentials.

Thank you for bringing this issue to our attention.
It is always recommended to use unique field names for your fields, however the idea of a validation warning for duplicate field names sounds neat and I will pass this on to Elliot.
Hopefully this will see it way into the plugin sometime soon 🙂

This isn’t going to be possible using the standard ACF relationship field.
Even if there was a filter hook available to return the posts you’d need to search the post type that is related to the post type and then do a reverse relationship query to return the posts in the first post type. My head hurts thinking about it 🙂

This is very similar to another thread about filtering users. I think that things like this are in the works.
The other question is here: http://support.advancedcustomfields.com/forums/topic/adding-image-to-the-relational-user-select-field/.
I’m sure that when Elliot works on that he will consider all of the other places that people might like these filters.

Hi @dnavarrojr
Thank you for the feature request.
The issue has been forwarded to the developer for consideration and hopefully this feature will see it way in to the plugin sometime soon 🙂
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.