I just solved the problem…
if( have_rows('group_field', 'option' ) ) {
while ( have_rows( 'group_field', 'option' ) ) {
the_row();
if( have_rows( 'flexible_content_field_name_inside_the_group_field' ) ) {
// do the flexible content thing
}
}
}
I made a WordPress Plugin for a simple table ACF-field https://wordpress.org/plugins/advanced-custom-fields-table-field/
This solves it.
http://www.advancedcustomfields.com/resources/acf-fields-relationship-query/
function my_relationship_query( $args, $field, $post ) {
// get posts for current logged in user
$args['author'] = get_current_user_id();
return $args;
}
add_filter('acf/fields/relationship/query/key=<field_key>', 'my_relationship_query', 10, 3);
May this is because the shortcode “button” does not exists anymore. Perhaps because you changed the theme or disabled a plugin. Did you realy made no changes?
You may can us an extra field of type true / false for “other” wich can be used at the conditional logic of a text field to toggle.
I gues, it is not possible to use a field type taxonomy at an conditional logic of another field.
Do you mean the "
is converting to ”
?
The first screenshot is about the select field with its taxonomy choices. Watch out the Conditional Logic Setting on screenshot 2 wich is from the text field. The text field should placed below the select field.
May this is, what you are looking for. First, the get_posts() function gets the posts from the post type “product” ordered by date with the latest date first and returning only the first result by ‘numberposts’ => 1. Then get the field value of that post using its ID.
$latest_post = get_posts(array(
'numberposts' => 1, // restrict result to only the latest post
'post_status' => 'publish',
'post_type' => 'product',
'orderby' => 'date',
'order' => 'DESC'
));
$prev = get_field( 'pref', $latest_post[0]->ID );
I made a feature request of this but because of another reason:
http://support.advancedcustomfields.com/forums/topic/restrict-relationship-fields-choices-to-current-user/
The following snippet gets all posts from a custom posttype “peoples” where the value of the ACF Field “assigned_team” is equal to the posts name.
$results = get_posts(array(
'numberposts' => -1,
'post_status' => 'any',
'post_type' => 'peoples',
'meta_query' => array(
array(
'key' => 'assigned_team',
'value' => $post->post_name
)
)
));
Is this what you are looking for?
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.