Last active
October 29, 2018 18:41
-
-
Save sunshinephotocart/8b036153bf0c1896d76c to your computer and use it in GitHub Desktop.
Sunshine Photo Cart: Filter image name to show file name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add this to your theme's functions.php file | |
// Or use this plugin https://wordpress.org/plugins/my-custom-functions/ | |
add_filter( 'sunshine_image_name', 'my_sunshine_image_name', 10, 2 ); | |
function my_sunshine_image_name( $name, $image ) { | |
return basename( get_attached_file( $image->ID ) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment