Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Iain Poulson

    (@polevaultweb)

    Hi Jenny

    1. This sounds like a bug. Does it get removed from the account after saving and or does it remain?

    2. The directory name can be changed with the ‘wpum_upload_dir’ filter

    Thread Starter ninsan

    (@jennyrigsjo)

    Hi @polevaultweb, thank you for replying. 🙂

    1) On the Account settings page, when I click on the ‘remove’ link next to each image and then click the ‘Update Profile’ button, the page reloads and a message saying “Profile successfully updated” is displayed. However, when I scroll down on the Account page both images are still there, as if they had never been removed. They are also still showing on the user’s Profile page. Unless something else is amiss in my local development environment, this seems like a potential bug to me.

    2) How would I go about writing the callback for the ‘wpum_upload_dir’ filter? I tried the following code but it threw me an internal server error:

     add_filter('wpum_upload_dir', 'jr_wpum_custom_uploads_directory');
    
     function jr_wpum_custom_uploads_directory($pathdata) {
    	 $wp_upload_dir = wp_get_upload_dir();
    
    	 $pathdata['path'] = $wp_upload_dir['path'];
    	 $pathdata['url'] = $wp_upload_dir['url'];
    	 $pathdata['subdir'] = $wp_upload_dir['subdir'];
    
    	 return $pathdata;
     }

    Thanks. 🙂

    /jenny

    Thread Starter ninsan

    (@jennyrigsjo)

    2) Nevermind, I figured out how to do it myself. 🙂 For anyone reading this who is new to programming (like me) and wondering how I did it, here is the code:

     add_filter('wpum_upload_dir', 'jr_wpum_custom_uploads_directory');
    
     /**
      * Set the WPUM uploads directory to the default WordPress uploads directory.
      * @param string $wpum_dir_name The name of the WPUM uploads directory.
      * @return string The (modified) directory name.
      */
     function jr_wpum_custom_uploads_directory($wpum_dir_name) {
    	 $wpum_dir_name = ''; // Empty string means the default WP uploads directory will be used.
    	 return $wpum_dir_name;
     }
    Plugin Contributor Iain Poulson

    (@polevaultweb)

    hey @jennyrigsjo glad you sorted the 2nd one.

    Yes the 1st sounds like a bug. Can you edit your wp-config.php file to replace this line –

    define( ‘WP_DEBUG’, false );

    With these lines –

    define(‘WP_DEBUG’, true);
    define(‘WP_DEBUG_LOG’, true);
    define(‘WP_DEBUG_DISPLAY’, false);

    This means that any errors are logged to `/wp-content/debug.log’, because some errors are not visible on screen.

    More details about that at http://codex.wordpress.org/Editing_wp-config.php#Debug

    Can you then retry the process and send me the debug.log file that should be created.

    Plugin Contributor Iain Poulson

    (@polevaultweb)

    If you drop me a mail via https://wpusermanager.com/contact/, then I can reply and you can attach the debug.log file in the email

    Thread Starter ninsan

    (@jennyrigsjo)

    Hi @polevaultweb , thanks for helping. 🙂 I enabled debugging in ‘wp-config.php’ according to your guidelines (I also had to deactivate another security plugin because it was preventing the ‘debug.log’ file from being created), however nothing is written to the ‘debug.log’ file when I try to delete the images from the test user’s account. There are a few lines of information in the file, but from what I can tell these warnings have nothing to do with what is happening (or not happening) on the WPUM user account page (there is no reference to the WPUM plugin in the warning messages). I can of course still send the file to you via email, if you want(?).

    /jenny

    Plugin Author WP User Manager

    (@wpusermanager)

    Hey @jennyrigsjo yes please, if you send me a message via https://wpusermanager.com/contact/ then I can troubleshoot further. Thanks for your help and patience!

    Thread Starter ninsan

    (@jennyrigsjo)

    Just dropped you a line via the WPUM contact form. 🙂

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How do I “unselect” a previously uploaded user avatar/cover image?’ is closed to new replies.