-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow Custom Rating Images To Be Put In Themes Folder #36
Comments
Actually, moving the custom images from the plugin folder to the theme folder is not so hard to develop. The only issue that I see here is backward-compatibility. |
We can do I by introducing a registration mechanism to register images folder: function add_custom_postratings_images_folder( $folders ) {
$folders['stars_crystal'] = WP_PLUGIN_DIR.'/wp-postratings/images/stars_crystal';
$folders['stars_dark'] = WP_PLUGIN_DIR.'/wp-postratings/images/stars_dark';
return $folders;
}
add_filter( 'wp_postratings_images', 'add_custom_postratings_images_folder' ); This way, the plugin will register all the default images in a single function and external developers will be able to register custom images located in themes on extended plugins. |
We can also extend this method to deprecate the 'wp_postratings_image_extension' filter and register all kinds of image extensions using an array: function add_custom_postratings_images_folder( $folders ) {
$folders['stars(png)'] = array( WP_PLUGIN_DIR.'/wp-postratings/images/stars(png)', 'png' );
$folders['stars_crystal'] = array( WP_PLUGIN_DIR.'/wp-postratings/images/stars_crystal', 'gif' );
$folders['stars_dark'] = array( WP_PLUGIN_DIR.'/wp-postratings/images/stars_dark', 'gif' );
return $folders;
}
add_filter( 'wp_postratings_images', 'add_custom_postratings_images_folder' ); This way we don't lose backwards compatibility. |
I like the second idea! |
Why not just define image path
|
lesterchan, you have plans to merge this to branch? |
@msxpro this is not a pull request, so there is nothing to merge. |
Erhhh ... sorry, asking the question better, are there plans to implement this in pluguin? Because this was also a request I made a few times, when I posted that modification on the links in the list of ratings. |
As of now, I have no plans because I have no time to do it. Feel free to submit a Pull Request =) |
ability to upload images would be great, save a step for our administrator to re-ftp images over and over after updates. |
https://wordpress.org/support/topic/custom-rating-images-lost-on-plugin-upgrade?replies=1#post-6404160
The text was updated successfully, but these errors were encountered: