From 17a39240f1e16dd712122a465b00d7c2e6ab60be Mon Sep 17 00:00:00 2001 From: Tim Groeneveld Date: Tue, 12 Dec 2017 13:12:43 +1100 Subject: [PATCH] deprecated callbacks in preg_replace. replace preg_replace_callback --- functions.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/functions.php b/functions.php index 947daaaa..cdd1dc0b 100644 --- a/functions.php +++ b/functions.php @@ -299,10 +299,12 @@ function wp_bootstrap_my_widget_tag_cloud_args( $args ) { // filter tag clould output so that it can be styled by CSS function wp_bootstrap_add_tag_class( $taglinks ) { $tags = explode('', $taglinks); - $regex = "#(.*tag-link[-])(.*)(' title.*)#e"; + $regex = "#(.*tag-link[-])(.*)(' title.*)#"; foreach( $tags as $tag ) { - $tagn[] = preg_replace($regex, "('$1$2 label tag-'.get_tag($2)->slug.'$3')", $tag ); + $tagn[] = preg_replace_callback($regex, function ($matches) { + return $matches[1].$matches[2].' label tag-'.get_tag($matches[2])->slug.$matches[3]; + }, $tag ); } $taglinks = implode('', $tagn);