Make WordPress Core

Changeset 45778


Ignore:
Timestamp:
08/10/2019 10:27:02 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Docs: Document the show_split_view argument for wp_text_diff().

Convert $args array documentation to hash notation.

Props riddhiehta02, jeremyfelt, SergeyBiryukov.
Fixes #47224.

File:
1 edited

Legend:

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

    r45715 r45778  
    26702670         * are equivalent, then an empty string will be returned.
    26712671         *
    2672          * The arguments supported and can be changed are listed below.
    2673          *
    2674          * 'title' : Default is an empty string. Titles the diff in a manner compatible
    2675          *      with the output.
    2676          * 'title_left' : Default is an empty string. Change the HTML to the left of the
    2677          *      title.
    2678          * 'title_right' : Default is an empty string. Change the HTML to the right of
    2679          *      the title.
    2680          *
    26812672         * @since 2.6.0
    26822673         *
    … …  
    26872678         * @param string       $left_string  "old" (left) version of string
    26882679         * @param string       $right_string "new" (right) version of string
    2689          * @param string|array $args         Optional. Change 'title', 'title_left', and 'title_right' defaults.
     2680         * @param string|array $args {
     2681         *     Associative array of options to pass to WP_Text_Diff_Renderer_Table().
     2682         *
     2683         *     @type string $title           Titles the diff in a manner compatible
     2684         *                                   with the output. Default empty.
     2685         *     @type string $title_left      Change the HTML to the left of the title.
     2686         *                                   Default empty.
     2687         *     @type string $title_right     Change the HTML to the right of the title.
     2688         *                                   Default empty.
     2689         *     @type bool   $show_split_view True for split view (two columns), false for
     2690         *                                   un-split view (single column). Default true.
     2691         * }
    26902692         * @return string Empty string if strings are equivalent or HTML with differences.
    26912693         */
    26922694        function wp_text_diff( $left_string, $right_string, $args = null ) {
    26932695                $defaults = array(
    2694                         'title'       => '',
    2695                         'title_left'  => '',
    2696                         'title_right' => '',
     2696                        'title'           => '',
     2697                        'title_left'      => '',
     2698                        'title_right'     => '',
     2699                        'show_split_view' => true,
    26972700                );
    26982701                $args     = wp_parse_args( $args, $defaults );
Note: See TracChangeset for help on using the changeset viewer.