Filter WP user acf field by ajax

The problem is your action names don’t match In your frontend code: ?action=find_coach’; But in your backend code: add_action(‘wp_ajax_search_coach’, ‘searchLifeCoach’); add_action(‘wp_ajax_nopriv_search_coach’, ‘searchLifeCoach’); search_coach != find_coach, they have to match. Note that if this code used the REST API, it would have given a 404 and stated the problem in human readable language, e.g. { “code”:”rest_no_route”, … Read more

Vimeo thumbnails [closed]

Maybe this can help $videoID = the_field(‘video_link’); $jsonurl=”http://vimeo.com/api/v2/video/”.$videoID.’.json’; $json = file_get_contents($jsonurl,0,null,null); $json_output = json_decode($json,true); echo ‘<img src=”‘. $json_output[0][‘thumbnail_large’] .'” />’; It’s the same call using json method

Problem with adding exta field in metabox in custom post type

You didn’t retrieve your 2 values in the save_post action. You need to get $_POST[’freebie-demo’] (it’s ok for it) and $_POST[‘freebie-downurl’] If you want an array post meta value based, you can do something like that : // Sanitize user input. $de_url[‘name’] = sanitize_text_field( $_POST[‘freebie-demo’] ); $de_url[‘url’] = esc_url($_POST[‘freebie-downurl’]); // Update the meta field in … Read more

Showing an ACF field in admin posts dashboard

This code worked perfectly fine: function custom_columns( $columns ) { $columns = array( ‘cb’ => ‘<input type=”checkbox” />’, ‘title’ => ‘Title’, ‘featured_image’ => ‘Image’, ‘categories’ => ‘Categories’, ‘amazon_url’ => ‘Amazon Link’, ‘comments’ => ‘<span class=”vers”><div title=”Comments” class=”comment-grey-bubble”></div></span>’, ‘date’ => ‘Date’ ); return $columns; } add_filter(‘manage_posts_columns’ , ‘custom_columns’); function custom_columns_data( $column, $post_id ) { switch ( … Read more