WordPress.org

Make WordPress Core

Changeset 34541


Ignore:
Timestamp:
09/25/2015 02:03:30 PM (3 years ago)
Author:
wonderboymusic
Message:

Revisions: add a 'wp_prepare_revision_for_js' filter.

Props jtsternberg, adamsilverstein.
Fixes #28627.

File:
1 edited

Legend:

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

    r31862 r34541  
    200200        }
    201201
    202         $revisions[ $revision->ID ] = array(
     202        $revisions_data = array(
    203203            'id'         => $revision->ID,
    204204            'title'      => get_the_title( $post->ID ),
     
    211211            'restoreUrl' => $can_restore ? $restore_link : false,
    212212        );
     213
     214        /**
     215         * Filter the array of revisions used on the revisions screen.
     216         *
     217         * @since 4.4.0
     218         *
     219         * @param array   $revisions_data The bootstrapped data for the revisions screen.
     220         * @param WP_Post $post           The revision's parent WP_Post object.
     221         */
     222        $revisions[ $revision->ID ] = apply_filters( 'wp_prepare_revision_for_js', $revisions_data, $post );
    213223    }
    214224
Note: See TracChangeset for help on using the changeset viewer.