WCUADD
Forum Replies Created
-
Forum: Plugins
In reply to: [Advanced Custom Fields: Image Crop Add-on] could you make it for customers?Hi,
I made it work on a front-end page and for all types of members, administrators or not.
front-end page and non-admin are 2 distincts problems.
for front-end page, please see the precedent message : https://www.ads-software.com/support/topic/crop-broken-brings-up-opaque-screen?replies=5
Then for non-admin, the problem isn’t specific to this plugin but first to the use of the wordpress media uploader in the front-end, and second to allow your members to upload files.
for the first problem, I had to manually add wp_enqueue_media() in order to show the media uploader (only for non-admin, I don’t know why) in functions.php
function load_wp_media_files() { // add a specific condition to select the pages the media uploader must appear wp_enqueue_media(); } add_action( 'wp_enqueue_scripts', 'load_wp_media_files' );
for the second problem, it relates to roles and capabilities. Your customer is certainly a member of your site, you must verify his role has the capability “upload_files”, and if not add it :
for instance, with the subscriber role :function add_theme_caps() { // gets the subscriber role $role = get_role( 'subscriber' ); // This only works, because it accesses the class instance. // would allow the subscriber to upload media for current theme only $role->add_cap( 'upload_files' ); } add_action( 'init', 'add_theme_caps');
With these little tricks, I’ve been able to have ACF crop image working on a front-end page and for all types of members.
Hope this can help!
Well, in fact, I forgot to tell that I was using ACF Image Crop Add-on inside a front-end page, with acf_form(). It is actually working fine on the backend side.
So apparently, from the front-end side, the problem is just about the overlay and the pop up window that comes when trying to crop. I don’t know why and didn’t have time to dig further. I simply deactivated the overlay with CSS
#acf-image-crop-overlay {
display:none;
}and it’s now working fine in the front-end too.
This is some kind of very ugly hack but it seems that the problem could be solved in a more elegant manner, if someone has more time.
FYI, I was using last version of WP (4.3.1), last version of ACF pro (5.3.2.2) and last version of ACF Image crop add-on (1.4.7).
Thank you for this plugin.
just install version 1.4.7
when trying to crop, brings an opaque popup screen, with just the possibility to move the portion you can crop but with no access to the buttons (cancel, crop) o anything else…
Had to reload the page, but it takes me to beginning.
So not working, will try with the earlier versions.