Skip to content

Instantly share code, notes, and snippets.

@tomharrigan
Created March 7, 2014 16:48
Show Gist options
  • Select an option

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

Select an option

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