plugin updates
This commit is contained in:
@@ -762,8 +762,8 @@ function wp_replace_in_html_tags( $haystack, $replace_pairs ) {
|
||||
// Optimize when searching for one item.
|
||||
if ( 1 === count( $replace_pairs ) ) {
|
||||
// Extract $needle and $replace.
|
||||
foreach ( $replace_pairs as $needle => $replace ) {
|
||||
}
|
||||
$needle = array_key_first( $replace_pairs );
|
||||
$replace = $replace_pairs[ $needle ];
|
||||
|
||||
// Loop through delimiters (elements) only.
|
||||
for ( $i = 1, $c = count( $textarr ); $i < $c; $i += 2 ) {
|
||||
@@ -2943,6 +2943,10 @@ function _make_url_clickable_cb( $matches ) {
|
||||
$suffix = $matches[3];
|
||||
}
|
||||
|
||||
if ( isset( $matches[4] ) && ! empty( $matches[4] ) ) {
|
||||
$url .= $matches[4];
|
||||
}
|
||||
|
||||
// Include parentheses in the URL only if paired.
|
||||
while ( substr_count( $url, '(' ) < substr_count( $url, ')' ) ) {
|
||||
$suffix = strrchr( $url, ')' ) . $suffix;
|
||||
@@ -3115,6 +3119,7 @@ function make_clickable( $text ) {
|
||||
)*
|
||||
)
|
||||
(\)?) # 3: Trailing closing parenthesis (for parenthesis balancing post processing).
|
||||
(\\.\\w{2,6})? # 4: Allowing file extensions (e.g., .jpg, .png).
|
||||
~xS';
|
||||
/*
|
||||
* The regex is a non-anchored pattern and does not have a single fixed starting character.
|
||||
@@ -3294,11 +3299,14 @@ function wp_rel_ugc( $text ) {
|
||||
*
|
||||
* @since 5.1.0
|
||||
* @since 5.6.0 Removed 'noreferrer' relationship.
|
||||
* @deprecated 6.7.0
|
||||
*
|
||||
* @param string $text Content that may contain HTML A elements.
|
||||
* @return string Converted content.
|
||||
*/
|
||||
function wp_targeted_link_rel( $text ) {
|
||||
_deprecated_function( __FUNCTION__, '6.7.0' );
|
||||
|
||||
// Don't run (more expensive) regex if no links with targets.
|
||||
if ( stripos( $text, 'target' ) === false || stripos( $text, '<a ' ) === false || is_serialized( $text ) ) {
|
||||
return $text;
|
||||
@@ -3332,11 +3340,14 @@ function wp_targeted_link_rel( $text ) {
|
||||
*
|
||||
* @since 5.1.0
|
||||
* @since 5.6.0 Removed 'noreferrer' relationship.
|
||||
* @deprecated 6.7.0
|
||||
*
|
||||
* @param array $matches Single match.
|
||||
* @return string HTML A Element with `rel="noopener"` in addition to any existing values.
|
||||
*/
|
||||
function wp_targeted_link_rel_callback( $matches ) {
|
||||
_deprecated_function( __FUNCTION__, '6.7.0' );
|
||||
|
||||
$link_html = $matches[1];
|
||||
$original_link_html = $link_html;
|
||||
|
||||
@@ -3383,46 +3394,20 @@ function wp_targeted_link_rel_callback( $matches ) {
|
||||
* Adds all filters modifying the rel attribute of targeted links.
|
||||
*
|
||||
* @since 5.1.0
|
||||
* @deprecated 6.7.0
|
||||
*/
|
||||
function wp_init_targeted_link_rel_filters() {
|
||||
$filters = array(
|
||||
'title_save_pre',
|
||||
'content_save_pre',
|
||||
'excerpt_save_pre',
|
||||
'content_filtered_save_pre',
|
||||
'pre_comment_content',
|
||||
'pre_term_description',
|
||||
'pre_link_description',
|
||||
'pre_link_notes',
|
||||
'pre_user_description',
|
||||
);
|
||||
|
||||
foreach ( $filters as $filter ) {
|
||||
add_filter( $filter, 'wp_targeted_link_rel' );
|
||||
}
|
||||
_deprecated_function( __FUNCTION__, '6.7.0' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all filters modifying the rel attribute of targeted links.
|
||||
*
|
||||
* @since 5.1.0
|
||||
* @deprecated 6.7.0
|
||||
*/
|
||||
function wp_remove_targeted_link_rel_filters() {
|
||||
$filters = array(
|
||||
'title_save_pre',
|
||||
'content_save_pre',
|
||||
'excerpt_save_pre',
|
||||
'content_filtered_save_pre',
|
||||
'pre_comment_content',
|
||||
'pre_term_description',
|
||||
'pre_link_description',
|
||||
'pre_link_notes',
|
||||
'pre_user_description',
|
||||
);
|
||||
|
||||
foreach ( $filters as $filter ) {
|
||||
remove_filter( $filter, 'wp_targeted_link_rel' );
|
||||
}
|
||||
_deprecated_function( __FUNCTION__, '6.7.0' );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3856,7 +3841,7 @@ function sanitize_email( $email ) {
|
||||
* Determines the difference between two timestamps.
|
||||
*
|
||||
* The difference is returned in a human-readable format such as "1 hour",
|
||||
* "5 mins", "2 days".
|
||||
* "5 minutes", "2 days".
|
||||
*
|
||||
* @since 1.5.0
|
||||
* @since 5.3.0 Added support for showing a difference in seconds.
|
||||
@@ -3884,8 +3869,8 @@ function human_time_diff( $from, $to = 0 ) {
|
||||
if ( $mins <= 1 ) {
|
||||
$mins = 1;
|
||||
}
|
||||
/* translators: Time difference between two dates, in minutes (min=minute). %s: Number of minutes. */
|
||||
$since = sprintf( _n( '%s min', '%s mins', $mins ), $mins );
|
||||
/* translators: Time difference between two dates, in minutes. %s: Number of minutes. */
|
||||
$since = sprintf( _n( '%s minute', '%s minutes', $mins ), $mins );
|
||||
} elseif ( $diff < DAY_IN_SECONDS && $diff >= HOUR_IN_SECONDS ) {
|
||||
$hours = round( $diff / HOUR_IN_SECONDS );
|
||||
if ( $hours <= 1 ) {
|
||||
@@ -5407,9 +5392,9 @@ function wp_html_excerpt( $str, $count, $more = null ) {
|
||||
*
|
||||
* @global string $_links_add_base
|
||||
*
|
||||
* @param string $content String to search for links in.
|
||||
* @param string $base The base URL to prefix to links.
|
||||
* @param array $attrs The attributes which should be processed.
|
||||
* @param string $content String to search for links in.
|
||||
* @param string $base The base URL to prefix to links.
|
||||
* @param string[] $attrs The attributes which should be processed.
|
||||
* @return string The processed content.
|
||||
*/
|
||||
function links_add_base_url( $content, $base, $attrs = array( 'src', 'href' ) ) {
|
||||
@@ -5499,11 +5484,11 @@ function normalize_whitespace( $str ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Properly strips all HTML tags including script and style
|
||||
* Properly strips all HTML tags including 'script' and 'style'.
|
||||
*
|
||||
* This differs from strip_tags() because it removes the contents of
|
||||
* the `<script>` and `<style>` tags. E.g. `strip_tags( '<script>something</script>' )`
|
||||
* will return 'something'. wp_strip_all_tags will return ''
|
||||
* will return 'something'. wp_strip_all_tags() will return an empty string.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user