Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

PHP: Override WPtouch's content_url function to make use of `content_url` instead of `WP_CONTENT_URL`.

View override-wptouch-urls.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
<?php
/*
Plugin Name: Override WPtouch URLs
Plugin URI: http://dessibelle.se
Description: Overrides WPtouch's content_url function to make use of `content_url` instead of `WP_CONTENT_URL`.
Author: Simon Fransson
Version: 1.0
Author URI: http://dessibelle.se/
*/
if ( !function_exists( 'compat_get_wp_content_url' ) ) {
function compat_get_wp_content_url() {
if (function_exists('content_url')) {
return content_url();
} elseif ( defined( 'WP_CONTENT_URL') ) {
return WP_CONTENT_URL;
} else {
return ABSPATH . 'wp-content';
}
}
}
Owner

Make sure this code loads before WPtouch, and Any Hostname will be able to filter the URLs returned by WPtouch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.