SHARE
TWEET

Eliminar enlaces de las imagenes de wordpress

VictorMisa Jul 18th, 2019 (edited) 620 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Código para eliminar el enlace de las imágenes en wordpress
  2.  
  3. Este codigo debes de añadirlo en el functions.php
  4.  
  5.  
  6. add_filter( 'the_content', 'attachment_image_link_remove_filter' );
  7.  function attachment_image_link_remove_filter( $content ) {
  8.   $content =
  9.   preg_replace(
  10.   array('{<a(.*?)(wp-att|wp-content/uploads)[^>]*><img}',
  11.   '{ wp-image-[0-9]*" /></a>}'),
  12.   array('<img','" />'),
  13.   $content
  14.   );
  15.   return $content;
  16.    }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top