wp_text_diff()显示一个HTML的文本

目录

描述

Displays a human readable HTML table with the difference between two strings.

If the two strings are equivalent, wp_text_diff returns an empty string. Otherwise, returns an html table showing the changes. Deletions and insertions in text are marked up using the <del> and <ins> html tags, respectively.

Primary use is for for displaying changes between an older version and a new revision of the string.

@uses Text_Diff
@uses WP_Text_Diff_Renderer_Table

wp_text_diff() 描述

用法

<?php wp_text_diff$left_string$right_string$args ); ?>

wp_text_diff() 用法

参数

$left_string

(string) (必填) "old" (left) version of string.

默认值: None

$right_string

(string) (必填) "new" (right) version of string.

默认值: None

$args

(string) (Optional. Change 'title', 'title_left', and 'title_right' defaults.) array

默认值: optional

Arguments

title

(string) (可选) Optional. Default is an empty string. Sets the title for the diff table.

默认值: null

title_left

(string) (可选) Optional. Default is an empty string. Sets the title for the left column (old version) of the diff table.

默认值: null

title_right

(string) (可选) Optional. Default is an empty string. Sets the title for the right column (new version) of the diff table.

默认值: null

wp_text_diff() 参数

返回值

(string

Empty string if strings are equivalent or an HTML table of differences.

wp_text_diff() 返回值

历史

添加于 版本: 2.6

wp_text_diff() 历史