Docs: Document the show_split_view argument for wp_text_diff().

Convert `$args` array documentation to hash notation.

Props riddhiehta02, jeremyfelt, SergeyBiryukov.
Fixes #47224.
Built from https://develop.svn.wordpress.org/trunk@45778


git-svn-id: http://core.svn.wordpress.org/trunk@45589 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2019-08-10 22:28:54 +00:00
parent 1a9812d9b4
commit 64290005f5
2 changed files with 17 additions and 14 deletions

View File

@ -2669,15 +2669,6 @@ if ( ! function_exists( 'wp_text_diff' ) ) :
* HTML, so the primary use is for displaying the changes. If the two strings
* are equivalent, then an empty string will be returned.
*
* The arguments supported and can be changed are listed below.
*
* 'title' : Default is an empty string. Titles the diff in a manner compatible
* with the output.
* 'title_left' : Default is an empty string. Change the HTML to the left of the
* title.
* 'title_right' : Default is an empty string. Change the HTML to the right of
* the title.
*
* @since 2.6.0
*
* @see wp_parse_args() Used to change defaults to user defined settings.
@ -2686,14 +2677,26 @@ if ( ! function_exists( 'wp_text_diff' ) ) :
*
* @param string $left_string "old" (left) version of string
* @param string $right_string "new" (right) version of string
* @param string|array $args Optional. Change 'title', 'title_left', and 'title_right' defaults.
* @param string|array $args {
* Associative array of options to pass to WP_Text_Diff_Renderer_Table().
*
* @type string $title Titles the diff in a manner compatible
* with the output. Default empty.
* @type string $title_left Change the HTML to the left of the title.
* Default empty.
* @type string $title_right Change the HTML to the right of the title.
* Default empty.
* @type bool $show_split_view True for split view (two columns), false for
* un-split view (single column). Default true.
* }
* @return string Empty string if strings are equivalent or HTML with differences.
*/
function wp_text_diff( $left_string, $right_string, $args = null ) {
$defaults = array(
'title' => '',
'title_left' => '',
'title_right' => '',
'title' => '',
'title_left' => '',
'title_right' => '',
'show_split_view' => true,
);
$args = wp_parse_args( $args, $defaults );

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.3-alpha-45777';
$wp_version = '5.3-alpha-45778';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.