grahamharper
Forum Replies Created
-
I have the same issue and was able to work around it by enabling Stripe Checkout.
I’m having the same problem with WP 4.2.1, even with ACF plugin disabled.
Sorry, only got to installed the latest version yesterday evening. Yes this appears to have solved my issue, working fine now.
Thanks so much for all your help.
Thanks for your help so far Jordy. I also wouldn’t recommend anyone using my code sample above. Particularly because the value of the
pathproperty ofwp_upload_dir()changes to the directory for the current month if uploads use year/month folders right?The fundamental problem here is that in several places in the code it makes the assumption that the uploads folder is in the same folder as the WordPress core files, which won’t always be the same.
This is just an idea (I haven’t checked how it would affect the CDN feature etc.) but what if we tried something more along the lines of the code below. It uses wp_upload_dir() instead of site_url().
function wr2x_get_pathinfo_from_image_src( $image_src ) { $uploads_url = trailingslashit( wp_upload_dir()['baseurl'] ); if ( strpos( $image_src, $uploads_url ) === 0 ) { return ltrim( substr( $image_src, strlen( $uploads_url ) ), '/'); } else if ( strpos( $image_src, wp_make_link_relative( $uploads_url ) ) === 0 ) { return ltrim( substr( $image_src, strlen( wp_make_link_relative( $uploads_url ) ) ), '/'); } else { $img_info = parse_url( $image_src ); return ltrim( $img_info['path'], '/' ); } } // Get WordPress upload directory function wr2x_get_wordpress_upload_root() { return wp_upload_dir()['basedir']; } function wr2x_from_system_to_url( $file ) { if ( empty( $file ) ) return ""; $retina_pathinfo = ltrim( str_replace( wr2x_get_wordpress_upload_root(), "", $file ), '/' ); $url = trailingslashit( wp_upload_dir()['baseurl'] ) . $retina_pathinfo; $url = wr2x_cdn_this( $url ); return $url; }I’m using Bedrock.
It would be great if a fix could be rolled into the plugin so I can install plugin updates without overwriting the fix.
That seems to have done the trick! When will this be in the production version?
Yes I can install manually, no problem.
http://staging.ignitenetwork.ie/blog/category/podcasts/
See the first post titled “Acts 9: Peter…”
The other posts on this page don’t exhibit this problem because I entered a manual excerpt. The problem only occurs with automatic excerpts.
Yes I have 6.0.1. Is there anything I need to do?
I also have latest version of WordPress (4.1.1) and Jetpack (3.3.2).
I’m having this problem too with audio file URL and links being duplicated in the_excerpt(). Is there a way to fix it?
Got it working by using
wp_upload_dir. The function now looks like:function wr2x_picture_rewrite( $buffer ) { if ( !isset( $buffer ) || trim( $buffer ) === '' ) return $buffer; require('inc/simple_html_dom.php'); $nodes_count = 0; $nodes_replaced = 0; $html = str_get_html( $buffer ); foreach( $html->find( 'img' ) as $element ) { $nodes_count++; $parent = $element->parent(); if ( $parent->tag == "picture" ) { wr2x_log("Found IE fallback img tag in picture tag, will ignore."); continue; } else { $file = basename( $element->src ); $upload_dir = wp_upload_dir(); $filepath = trailingslashit( $upload_dir['path'] ) . $file; $potential_retina = wr2x_get_retina( $filepath ); $from = substr( $element, 0 ); if ( $potential_retina != null ) { $retina_pathinfo = ltrim( str_replace( WP_CONTENT_DIR, "", $potential_retina ), '/' ); $retina_url = trailingslashit( content_url() ) . $retina_pathinfo; $img_url = $element->src; $element->srcset = "$img_url, $retina_url 2x"; $element->src = null; $to = $element; $buffer = str_replace( trim( $from, "</> "), trim($to, "</> "), $buffer ); wr2x_log( "Replaced img tag '$from' by '$to'" ); $nodes_replaced++; } } } if ( wr2x_is_debug() ) { wr2x_log( "$nodes_replaced img tags were replaced out of $nodes_count." ); } return $buffer; }Forum: Plugins
In reply to: [CPT Bootstrap Carousel] Featured Image Column Appearing for all Post TypesNo sweat. Thanks for the work on plugin!
Forum: Plugins
In reply to: [Plugin: Stripe] Card/Javascript error when checking outI’m having the same issue. Did you ever get it resolved?
Forum: Fixing WordPress
In reply to: Viewing site asks for my FTP passwordThanks so much, it was Akismet causing the problem.