Make WordPress Core


Ignore:
Timestamp:
10/29/2014 07:01:15 PM (10 years ago)
Author:
johnbillion
Message:

Introduce some actions and filters which aid plugins in revisioning post meta.

  • wp_save_post_revision_post_has_changed filter which can be used to determine if a post has been changed, and therefore if a revision should be created for a post.
  • wp_get_revision_ui_diff filter which can be used to filter the fields displayed in the post revision diff UI.
  • wp_creating_autosave action which is fired just before an autosave is created.

See #20564.
Props mattheu, adamsilverstein.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/revision.php

    r29206 r30091  
    9393        }
    9494    }
    95     return $return;
     95
     96    /**
     97     * Filter the fields displayed in the post revision diff UI.
     98     *
     99     * @since 4.1.0
     100     *
     101     * @param array   $return       Revision UI fields. Each item is an array of id, name and diff.
     102     * @param WP_Post $compare_from The revision post to compare from.
     103     * @param WP_Post $compare_to   The revision post to compare to.
     104     */
     105    return apply_filters( 'wp_get_revision_ui_diff', $return, $compare_from, $compare_to );
     106
    96107}
    97108
Note: See TracChangeset for help on using the changeset viewer.