Support

Account

Home Forums Bug Reports WordPress 3.6 Revisions: custom fields no longer tracked Reply To: WordPress 3.6 Revisions: custom fields no longer tracked

  • I recently created a custom field type, which stores the data in an associative array. The revision preview for the field was therefore broken. I solved the problem by adding a filter on line 127 of core/controllers/revisions.php:
    $value = apply_filters('acf/input/'.$field['type'].'/revision_format', $value);
    And adding the filter in my custom field __contsruct method like so:
    add_filter('acf/input/heirachial_relationship/revision_format', array($this, 'format_value_for_revision') );

    function format_value_for_revision($value) {
       // Do your thing
       return $value;
    }

    Be great to see this added to the core Elliot. Though the filter may not be named in keeping with the rest of the plugin.