
Hi @mallander
There is WP plugin that extends the ACF functionality and allows you to add the custom fields to the Quick edit screen.
You can check it out here: https://github.com/mcguffin/acf-quick-edit-fields
I hope this helps 🙂

Hi @eafarooqi
Thank you for submitting this bug report.
This was a persistent bug but it has since been fixed in the latest version 🙂

Hi @mvital
This issue is very strange the above code should be able to work. You should try to investigate whether there could be a plugin conflict that could be affecting the loading of the map on the front end.
I would also suggest using an iframe to try and display the field using the following example code:
<iframe width="400" height="400" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.ca/maps?center=<?php the_field('mapa'); ?>&q=<?php the_field('maps'); ?>&zoom=14&size=300x300&output=embed&iwloc=near"></iframe><br />

Hi @projecthh
You can make use of the acf/fields/relationship/query hook to modify the $args array which is used to query the posts shown in the the relationship field list.
You can have something as follows:
<?php
function my_relationship_query( $args, $field, $post )
{
// increase the posts per page
$args['posts_per_page'] = 25;
return $args;
}
add_filter('acf/fields/relationship/query', 'my_relationship_query', 10, 3);
You can read up on this here: http://www.advancedcustomfields.com/resources/acf-fields-relationship-query/

Hi @spen
@brugman solution should be able to solve the issue since having posts_per_page set to -1 allows us to display an unlimited number of results. You could also add a ‘&’ and then another parameter after “posts_per_page=-1″ to further alter the query.
The following could also work :
$args = array(
'posts_per_page' => a'-1',
);
query_posts( $args );

Thank you for the suggestion.
This would really make a nice addition to the plugin and in light of this, the information has been sent to the developer for consideration.
I would however suggest you post any feature requests under this category.
Hi James
Thanks for getting back to me. Sorry I wasn’t more specific in my question. It isn’t the jQuery tabs I needed; it was the ability to add or filter the checkbox choices “on-the-fly” using the ajax input.
Thanks.
John
Try this
function get_post_ids_within_range(){
global $wpdb;
$datenow = date(time());
$post__in = array();
$post_type = “properties”;
$acf_pref = “kidum_”;
$sql = ”
SELECT post_id,
substring_index(meta_key,’_’,2) as field_joiner,
max( case when substring_index(meta_key,’_’,-1) = ‘from’ AND UNIX_TIMESTAMP(meta_value) <= $datenow then meta_value end) as date_from,
max( case when substring_index(meta_key,’_’,-1) = ‘to’ AND UNIX_TIMESTAMP(meta_value) >= $datenow then meta_value end) as date_to
FROM $wpdb->postmeta
WHERE meta_key LIKE ‘$acf_pref%’
AND post_id IN(SELECT ID FROM $wpdb->posts WHERE post_type='{$post_type}’ AND post_status=’publish’)
GROUP BY post_id,field_joiner
having date_to <> ” AND date_from <> ”
” ;
$rows = $wpdb->get_results($sql);
foreach($rows as $row){
$post__in[] = $row->post_id;
}
return $post__in;
}

Hi @crixlet
I use the following practice for the saving of my fields.
For the field labels I always use unique field names that are descriptive of the custom fields. As for the field names, since when saving sub fields, the ‘save name’ is generated by the ancestors names + the row index, I always try to keep them short and unique.

Hi @davidw
I am not quite familiar with the Builpress Theme but this might what is causing the issue. I would recommend you begin by switching to one of the default WP themes and if the ACF plugin appears then you will need to look for custom functions in the theme files that would be hiding the ACF plugin in the Builpress theme.
You can hide the admin panel using the following function:
add_filter('acf/settings/show_admin', '__return_false');

Hi @tkapler
ACF uses the field name to save its data and thus to avoid data loss and also enable synchronization of your fields it is recommended to enable field group translation.
Each language will require it’s own translation of a field group. You should create your field group in the default language and then use the ‘Duplicate’ tool to create a duplicate field group in the new language. You can then edit the field’s label, settings but the field’s name must remain constant across all translations.

But you have the filtering working?
As far as the repeating tags, do you mean this part of your code is?
<ul id="filters" class="filter-menu">
<?php while ( $postlist->have_posts() ) : $postlist->the_post(); ?>
<?php $posttags = get_the_tags();
echo '<li><a href="#" class="active" data-filter="*">Alles</a></li>';
if ($posttags) {
foreach($posttags as $tag) {
echo '<li><a href="#" data-filter="' . '.' . $tag->name . '">' . $tag->name . '</a></li>';
}
}
?>
<?php endwhile; ?>
</ul>

The easiest way is to add a meta_key and orderby to your args
$args = array(
'post_type' => 'propriedades',
'meta_key' => 'price_field_name',
'orderby' => 'meta_value_num',
'order' => 'DESC',
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'tipo_de_propriedade',
'value' => 'Apartamento',
'compare' => '='
),
array(
'key' => 'dormitorios_do_imóvel',
'value' => '3 Dormitórios',
'compare' => '='
)
)
);

You add filters and actions.
I’m pretty sure this is all in the documentation somewhere so this is just a quick overview.
Examples:
// add options pages
add_action('init', 'add_theme_options_pages');
function add_theme_options_pages() {
if (!function_exists('acf_add_options_sub_page')) {
return;
}
// add code here to add options pages
}
// add custom fields
// export the field groups and use below
add_action('acf/include_fields', 'add_theme_field_groups');
function add_theme_field_groups() {
// you can get the code you need here by exporting
// your field group to PHP
// you could also use JSON, search for ACF Local JSON
}
Hope this helps.

Hi guys
Thanks for the feature request. I like it and will add it in!
Cheers
E
A solution to set hidden/disabled attribute on a regular field would be helpful when creating front-end forms for submitting data.
Example:
Filling an inquiry form for a product, the populated acf_form in the front end can grab current ID from product page and pre fill an ACF Post Object type with it’s current ID.
Maybe this settings can be available in the acf_form() options arguments when populating the form or via load_field/name={$fieldname} filter
Somthing like:
add_filter('acf/load_field/name=property','wc_set_field');
function wc_set_field($field){
if( !is_admin() && is_single() ){
$pid = get_the_ID();
$field['default_value'] = $pid;
$field['disabled'] = true;
$field['hidden'] = true;
}
//same in, same out
return $field;
}
This way the field value is blocked in the frontend but it can be changed using the regular backend edit screen normally without changing its field type.
I see myself using ACF a lot to solve front end forms. This feature can help create relations easier.
Thanks for the great work on ACF.
One more follow-up question:
Right now I have a select field with options like “Martin (MN)”. The only reason I have (MN) included is so A) if there were a Martin MN and a Martin WI, these two choices would be different, and B) so the user can tell the difference while selecting counties. However, when displaying the field on my site, I only want to display the name “Martin”, and not “(MN)”. Is the only real solution here some sort of PHP string function, like somehow not displaying the last 5 characters of any county field?
Thanks again.
Thank you for the ideas.
As for the first question, I’m thinking about moving all counties to one dropdown field. For the values I would use something like “martin_mn” with the label “Martin” to represent Martin County, Minnesota. With the combobox option enabled, I don’t think this would be a problem for data-entry, as the user can simply “search” for the county they want to select.

Hi James,
Thanks for your reply, but my question was regarding exporting fields.
When you do:
1. auto populate fields using example you shared
2. you export fields as php, so you can include them somewhere and you don’t have to re-create fields
you also get values exported for a select field you were auto populating.

Hi @eafarooqi,
From your code, you are hooking into the update_value function for a specific field and thus you cannot use the update_field() function within this function.
I would suggest you hook into the filter for every field or possibly use the update field() function for the other fields on their own.

Hi @alysko
Thank you for the feature request.
Kindly offer more details on your desired functionality for instance, would you like a search field to search other posts or to search the values contained in the acf_form?
This is great John, thank you for sharing. I’ll have a look and if I have any questions I’ll ping you on github. Many thanks again!

Hi @jrstaatsiii,
Thank you for sharing the solution. I will now copy the same to this forum so that it can help out a fellow dev in future:
<?php
/*
* Returns the first instance of a given layout option
* @param - $id - the id of the post you are trying to target: '' by default
* @param - $fc_field - the name of the ACF flexible field: 'content_blocks' as the default
* @param - $fc_layout - the name of the flexible content layout: 'visual_editor' as the default
* @return - mixed
* @todo - test different types of returned content. at the moment, I am only using this for returning a string
*/
function get_first_instance_of_content_block( $id = '', $fc_field = 'content_blocks', $fc_layout = 'visual_editor' ) {
if ( class_exists('acf') ) {
if ( have_rows( $fc_field, $id ) ) {
$content_blocks = get_field( $fc_field, $id );
$content = array();
foreach ( $content_blocks as $block ) {
if ( $block['acf_fc_layout'] == $fc_layout ) {
$content[] = $block[$fc_layout];
}
}
reset($content);
return $content[0];
}
} else {
return '<p class="error">Advanced Custom Fields is required for <code>get_first_instance_of_content_block()</code> to work.</p>';
}
}

Hi @chriswhiteley,
You can make use of the the WP_Query object to load all the posts ordered by a custom field in your case based on the last_name field:
The code will look something like this:
<?php
// query
$the_query = new WP_Query(array(
'post_type' => 'post_type_name',
'posts_per_page' => -1,
'meta_key' => 'last_name',
'orderby' => 'meta_value_num',
'order' => 'ASC'
));
?>

Hi @solserpiente,
The conversion of text inputs to pst tags would only work for single value custom fields in which case you would need the following JQuery function for the implementation(it should go to your functions.php file):
<?php
function convert_custom_fields_to_tags(){ ?>
<script type="text/javascript">
jQuery(document).ready(function($){
// Create list of custom fields to add as tags on save
// (e.g. var custom_field_names = ['my_custom_field', 'my_other_custom_field', 'yet_another_custom_field'];)
var custom_field_names = [];
$('form#post').submit(function(){
if(custom_field_names.length > 0) {
var custom_field_values = [];
$('#postcustom tr[id^="meta-"]').each(function(){
var meta_id = $(this).attr('id').substring($(this).attr('id').indexOf('-')).replace('-','');
if ($.inArray($(':text[id="meta[' + meta_id + '][key]"]').val(), custom_field_names) !== -1) {
custom_field_values.push($('textarea[id="meta[' + meta_id + '][value]"]').val().toLowerCase());
}
});
var tags = custom_field_values.join(',');
$('#new-tag-post_tag').val(tags);
}
});
});
</script>
<?php }
add_action('admin_footer', 'convert_custom_fields_to_tags');
?>
You would then need to add the custom field names to the custom_field_names array as follows:
var custom_field_names = ['my_custom_field', 'my_other_custom_field'];
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.