Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Daniel Bachhuber

    (@danielbachhuber)

    Yep, I’ve put together a little code snippet you can follow:

    add_action( 'init', 'wpfx_hide_logged_out' );
    function wpfx_hide_logged_out() {
    
    	if ( ! is_user_logged_in() ) {
    		add_shortcode( 'fu-upload-form', 'wpfx_logged_out_message' );
    	}
    }
    function wpfx_logged_out_message() {
    	return '<div id="ugc-media-logged-out">You must be logged in to submit a post.</div>';
    }

    Hope this helps.

    Plugin Author Rinat

    (@rinatkhaziev)

    Thanks Daniel!

    Angels22

    (@angels22)

    Where would one add this?

    Update, couple minutes later: Oh, I got it, you add it to the functions.php
    Just in case anyone else was wondering…
    Works great, thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Upload only for logged in users?’ is closed to new replies.