Advanced Custom Fields filter instructions – AFC
Filter Instructions
function my_acf_load_field( $field ) {
//var_dump($field);
global $post;
$this_val = get_post_meta($post->ID,'access_code',true);
$this_link = get_the_permalink($post->ID);
$full_link = "$this_link?access_code=".$this_val;
$field['instructions'] = "<a href='$full_link' target='_blank'>$full_link</a>";
//$field['value'] = 'dammm'.$field['value'];
return $field;
}
add_filter('acf/load_field/name=access_code', 'my_acf_load_field');
function support_menu_choices( $field ) {
$data[] = "Main";
$field['choices'] = $data;
$menus = get_terms('nav_menu');
foreach($menus as $menu){
$data[] = $menu->name;
}
$field['choices'] = $data;
return $field;
}
add_filter('acf/load_field/name=support_menu', 'support_menu_choices');