Viewing 1 replies (of 1 total)
  • 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://wordpress.org/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!

Viewing 1 replies (of 1 total)
  • The topic ‘could you make it for customers?’ is closed to new replies.