Use of wptexturize produces broken links and paths
-
Hi again !
As I said, here is a post about problems I encountered because of the WordPress functionwptexturize
(documentation).When I started using plugin, all paths and links were broken. Here is the complete list of attributes available in templates which were broken:
file_url
base_file
file
path
To make things work, I had to modify the plugin a bit.
The culprit waswptexturize
that makes some text transformations which produces wrong path, url or links.
Inclass-mla-shortcode-support.php
file I replaced this (line 1007):
$item_values['file_url'] = wptexturize( $attachment->guid );
By this:
$item_values['file_url'] = $attachment->guid;
I also replaced this (line 1060):
$item_values['base_file'] = wptexturize( $base_file ); $item_values['file'] = wptexturize( $base_file );
By this:
$item_values['base_file'] = $base_file; $item_values['file'] = $base_file;
And this (line 1068):
$item_values['base_file'] = wptexturize( $base_file ); $item_values['path'] = wptexturize( substr( $base_file, 0, $last_slash + 1 ) ); $item_values['file'] = wptexturize( $file_name );
By this:
$item_values['base_file'] = $base_file; $item_values['path'] = substr( $base_file, 0, $last_slash + 1 ); $item_values['file'] = $file_name;
Now everything is working fine. Why did you used
wptexturize
on these variables ?
- The topic ‘Use of wptexturize produces broken links and paths’ is closed to new replies.