I had to replace
$query->set( 'meta_query', array(
'key' => 'isbn',
'value' => $isbn
) );
with
$query->set( 'meta_query', array(
array(
'key' => 'isbn',
'value' => $isbn
)
)
);
That is, nesting the array into another array as in docs
Oh thank god i found this thread.
Thank you everyone who helped fixing the issue!
Marc
OK, yes, sorry
The theme is ok, but it gets broken when WPML plugin is activated.
That is exactly it. Thank you!
My example:
add_filter('acf/validate_value/name=event_category', 'validate_empty_fields', 10, 4);
function validate_empty_fields( $valid, $value, $field, $input ){
// bail early if value is already invalid
if( !$valid ) {return $valid; }
$is_event_public = $_POST['acf']['field_55420ab8d2eb2']; // This field is a checkbox
if($is_event_public){
if(!$value){
$valid = __('This field is required for public events');
}
}
return $valid;
}
Thank you! I will give it a try
using @relish27 suggestion
<?php the_field('field_name', $post_object->ID); ?>
instead of
wp_reset_post_data();
saved my life.
I was not able to get
wp_reset_post_data();
to without a main loop, just with custom queries.
this code
function my_mce_buttons_2($buttons) {
/**
* Add in a core button that's disabled by default
*/
$buttons[] = 'superscript';
$buttons[] = 'subscript';
return $buttons;
}
add_filter('mce_buttons_2', 'my_mce_buttons_2');
from the codex worked for me
OK, thank you.
Following with the example, we will end up doing the following:
Which is ok.
But yeah, i think it would be better to be able to add new pupils inside the edit classroom page.
Thank you!
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.