Make WordPress Core

Ticket #28627: 28627.diff

File 28627.diff, 1.1 KB (added by jtsternberg, 12 years ago)

Proposed filter

  • wp-admin/includes/revision.php

     
    211211                'fields' => wp_get_revision_ui_diff( $post->ID, $from, $selected_revision_id ),
    212212        ));
    213213
    214         return array(
     214        $revisions_settings = array(
    215215                'postId'           => $post->ID,
    216216                'nonce'            => wp_create_nonce( 'revisions-ajax-nonce' ),
    217217                'revisionData'     => array_values( $revisions ),
     
    222222                'compareTwoMode'   => absint( $compare_two_mode ), // Apparently booleans are not allowed
    223223                'revisionIds'      => array_keys( $revisions ),
    224224        );
     225
     226        /**
     227         * Filter the revisions settings used for the revisions JS.
     228         *
     229         * @since 4.0.0
     230         *
     231         * @param array   $revisions_settings The settings array
     232         * @param WP_Post $post               The original post object which owns the revisions
     233         */
     234        $revisions_settings = wp_parse_args( apply_filters( 'revisions_settings_for_js', $revisions_settings, $post ), $revisions_settings );
     235
     236        return $revisions_settings;
    225237}