Frontend Uploader
[resolved] Upload only for logged in users? (4 posts)

  1. Marketing Master
    Posted 3 years ago #

    Is there any possibility to restrict upload only for registered and logged in users?

    Thx, BR


  2. Daniel Bachhuber
    Hand Built
    Plugin Contributor

    Posted 3 years ago #

    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.

  3. Rinat Khaziev
    Plugin Author

    Posted 3 years ago #

    Thanks Daniel!

  4. Angels22
    Posted 3 years ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Frontend Uploader
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.