Viewing 5 replies - 1 through 5 (of 5 total)
  • I’m also looking for the same functionality on this.

    Please advise if there is a solution or a work around.

    Thanks!!!

    Rick

    Anyone?

    Here’s a change that you can make to the plugin code to get you partway there: It will prevent anyone from submitting a review unless they’re logged in.

    Note that this change will be overwritten the next time you upgrade the plugin, so make sure you keep a backup copy on hand after you implement, so that you can restore this again as needed later. Also this hasn’t been extensively tested; I can’t promise it won’t break something else or cause unwanted behavior elsewhere (though I seriously doubt it will). Finally, if you’re unfamiliar with editing WordPress files, then proceed carefully – take a backup of everything before you begin, and be sure you have access to your server via FTP so that you can restore the backup if needed.

    All those warnings aside, this is an easy change.

    1. Open up the plugin file wp-customer-reviews.php (it’s located in /wp-content/plugins/ – you can get there through the WordPress backend via Appearance -> Editor then switch to the WP Customer Reviews plugin in the dropdown menu on top right).

    2. Go to line 1142 – easiest if you’re using a code editor. If you’re in the WP backend then use your browser Find command and look for the string “only do regex matching if not blank” which is in a comment (indicated by ‘/* */’). You want to place this code snippet right above that line.

    3. Insert:

    /* Prevents people from submitting unless logged into the site */
    		if ( !is_user_logged_in() ) {
                $errors .= 'You must be logged into this site in order to leave a review.<br />';
    		}

    This is very rudimentary; it processes the submit but then throws an error on the refreshed screen. Hopefully it’s useful to someone.

    @essaysnark Thanks for your time ?? but thats not what I’m looking for. I’ve already hidden the review form unless you are logged into the site, my next task is try to import the currently logged on username into name field…

    Link to my review-page: https://www.brabet.se/lasartips/

    Something else? I need this too.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Set name field as currently logged on username’ is closed to new replies.