2

I am importing the images from XML using a plugin, it truncates the image link while importing. Some symbols are causing the images not to show in the posts. This is the image link.
What it shows is mydomain.com/wp-content/uploads/2014/03/watermark.jpeg I need a php function which escapes the special characters in a URL. (Wordpress Plugin Name: WP-ALLIMPORT)

  • If you don't know the answer, stop giving downvotes to people. Its not a plugin issue. I am asking for a php function which can escape the special characters. – itsWrongGuy Mar 19 '14 at 10:13
  • You might have to extract the link, run esc_url on that, and then rebuild the link. – Scott C Wilson Jul 5 '17 at 4:50
1

Because based on your description, I am not sure what is your purpose doing the escape.

If you want to escape the URL, you might consider using Wordpress internal esc_url() function

If you want to do some more low level control with PHP native function, you may consider urlencode() and you might have to manually urldecode() it in some cases depending on your purpose

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.