Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dessibelle
Created November 28, 2011 17:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dessibelle/1401269 to your computer and use it in GitHub Desktop.
Save dessibelle/1401269 to your computer and use it in GitHub Desktop.
PHP: Override WPtouch's content_url function to make use of `content_url` instead of `WP_CONTENT_URL`.
<?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';
}
}
}
@dessibelle
Copy link
Author

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