函数
wp_replace_in_html_tags ( $haystack, $replace_pairs )
- 参数
-
-
(string)
$haystack
The text which has to be formatted.- Required: 是
-
(array)
$replace_pairs
In the form array(‘from’ => ‘to’, …).- Required: 是
-
(string)
- 返回值
-
- (string) The formatted text.
- 定义位置
-
-
wp-includes/formatting.php
, line 753
-
wp-includes/formatting.php
- 引入
- 4.2.3
- 弃用
- –
Replaces characters or phrases within HTML elements only.
function wp_replace_in_html_tags( $haystack, $replace_pairs ) { // Find all elements. $textarr = wp_html_split( $haystack ); $changed = false; // Optimize when searching for one item. if ( 1 === count( $replace_pairs ) ) { // Extract $needle and $replace. foreach ( $replace_pairs as $needle => $replace ) { } // Loop through delimiters (elements) only. for ( $i = 1, $c = count( $textarr ); $i
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。