Skip to content

Instantly share code, notes, and snippets.

@GeoffEW
Created October 11, 2016 02:16
Show Gist options
  • Save GeoffEW/bedaf6534e1b3ca435ea4cd6aae23d2e to your computer and use it in GitHub Desktop.
Save GeoffEW/bedaf6534e1b3ca435ea4cd6aae23d2e to your computer and use it in GitHub Desktop.
Fix loading of ET+ files even if page structure changes (e.g. Jupiter theme)
<?php
function tribe_snippet_clean_filename( $filename, $filename_raw ) {
if ( 0 === strpos( $filename, '.' ) && false === strpos( $filename_raw, '.' ) ) {
return substr( $filename, 1 );
}
return $filename;
}
add_filter( 'sanitize_file_name', 'tribe_snippet_clean_filename', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment