Skip to content

Commit

Permalink
Docs: Document the show_split_view argument for wp_text_diff().
Browse files Browse the repository at this point in the history
Convert `$args` array documentation to hash notation.

Props riddhiehta02, jeremyfelt, SergeyBiryukov.
Fixes #47224.

git-svn-id: https://develop.svn.wordpress.org/trunk@45778 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Aug 10, 2019
1 parent f88cc8a commit 6ca6c44
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions src/wp-includes/pluggable.php
Original file line number Diff line number Diff line change
Expand Up @@ -2669,15 +2669,6 @@ function get_avatar( $id_or_email, $size = 96, $default = '', $alt = '', $args =
* 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.
Expand All @@ -2686,14 +2677,26 @@ function get_avatar( $id_or_email, $size = 96, $default = '', $alt = '', $args =
*
* @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 );

Expand Down

0 comments on commit 6ca6c44

Please sign in to comment.