Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: revision_text_diff_options

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
89            *     Associative array of options to pass to {@see wp_text_diff()}.
90            *
91            *     @type bool $show_split_view True for split view (two columns), false for
92            *                                 un-split view (single column). Default true.
93            * }
94            * @param string  $field        The current revision field.
95            * @param WP_Post $compare_from The revision post to compare from.
96            * @param WP_Post $compare_to   The revision post to compare to.
97            */
98           $args = apply_filters( 'revision_text_diff_options', $args, $field, $compare_from, $compare_to );
99
100           $diff = wp_text_diff( $content_from, $content_to, $args );
101
102           if ( ! $diff && 'post_title' === $field ) {
103                // It's a better user experience to still show the Title, even if it didn't change.
104                // No, you didn't see this.
105                $diff = '<table class="diff"><colgroup><col class="content diffsplit left"><col class="content diffsplit middle"><col class="content diffsplit right"></colgroup><tbody><tr>';
106                $diff .= '<td>' . esc_html( $compare_from->post_title ) . '</td><td></td><td>' . esc_html( $compare_to->post_title ) . '</td>';
107                $diff .= '</tr></tbody>';