Wait a minute... This content is very very old. We no longer sell or support this theme version. New Topics
Version 9
cat j
0 points
Beginner
Im looking for a php code to add to functions.php to remove a href and http tags from single custom fields, meaning, I want some custom fields to have links allowed and selected custom fields no links allowed.
Anyone have a working code that specifically targets a single custom field?
eg:
custom field database name = cftext
eg:
[code title=””]$string = “Admin doesnt want me to but I put links in it”“;
$result = preg_replace(‘/(.*?)<\/a>/’, “\\2”, $string);
echo $result; // this will output “Admin doesnt want me to but I put links in it”[/code]
I need to remove <a
and http
for NO links allowed.
And I would really prefer that any texts added with a or http are deleted completely with no texts stored/shown.
Im looking for a php code to add to functions.php to remove a href and http tags from single custom fields, meaning, I want some custom fields to have links allowed and selected custom fields no links allowed.
Anyone have a working code that specifically targets a single custom field?
eg:
custom field database name = cftext
eg:
[code title=””]$string = “Admin doesnt want me to but I put links in it”“;
$result = preg_replace(‘/(.*?)<\/a>/’, “\\2”, $string);
echo $result; // this will output “Admin doesnt want me to but I put links in it”[/code]
I need to remove <a
and http
for NO links allowed.
And I would really prefer that any texts added with a or http are deleted completely with no texts stored/shown.
Members Only Content
This reply is for PremiumPress customers only.
Login Now