Skip to content

Instantly share code, notes, and snippets.

@tomharrigan
Created March 6, 2014 15:36
Show Gist options
  • Select an option

  • Save tomharrigan/9392356 to your computer and use it in GitHub Desktop.

Select an option

Save tomharrigan/9392356 to your computer and use it in GitHub Desktop.
function my_acf_load_field( $field ) {
$tdrfullwidth = get_post_custom_values('_tdrfullwidth');
if( isset( $tdrfullwidth ) ) {
if( $tdrfullwidth === 'on') {
$field['default_value'] = 'parallax';
}
delete_post_meta( get_the_id(), '_tdrfullwidth');
}
return $field;
}
add_filter('acf/load_field/name=full_width_header', 'my_acf_load_field');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment