How to filter get_post with ACF by a checkbox field?

So, the scattered documentation on this is really less than clear. For checking for unchecked posts added the following meta_query: ‘meta_query’ => array(array( ‘key’ => ‘external’, ‘value’ => ‘0’, ‘compare’ => ‘=’ )) For filtering by checked it was just this: meta_query => array(array( ‘key’ => ‘external’, ‘value’ => ‘0’, ‘compare’ => ‘=’ ))

change value of fields created with advanced custom fields in the front

If you want to include your own inputs on the acf_form() you should use some of its parameters to allow the form submit them. Otherwise your inputs will be out of the form. As an example you could use this code: <?php acf_form( array( ‘html_after_fields’ => ‘<input type=”text” id=”id_whatsapp” name=”acf[n_whatsapp]” value=”acf[n_whatsapp]”>’, ) ); ?> You … Read more

ACF: How to make get_field() ignore the main wp query?

I resolved this by adding wp_query->is_main_query() to my clauses before I set the query update. Ie… // The filter code that shows only the current authors posts add_action(‘pre_get_posts’, ‘query_set_only_author’); function query_set_only_author( $wp_query ) { if( is_admin() && get_current_user_role()==”required_role” && $wp_query->is_main_query() ) { if ( basename($_SERVER[‘PHP_SELF’])==”edit.php”){ $wp_query->set( ‘author’, $current_user->ID ); } }

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)