Support » Plugin: Frontend Uploader » Upload only for logged in users?

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


    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 Khaziev


    Thanks Daniel!

    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.