mesonrhinitis
Forum Replies Created
-
@pixelbart I sent you and email, thanks
@pixelbart I have installed the plugin but I don’t think the $session variable is set. Do I have to change the global $_SESSION variable after installing the plugin?
Will it help if I can show you my case on Microsoft Teams for example? I don’t really get any error messages that will explain it.
@pixelbart thanks again for helping. I updated the plugin and tried the code. But it doesn’t seem to do the job yet. The user information is stored in $_SESSION[‘data’]. I changed it to the following:
function custom_function( $fields, $session ) { if ( isset( $_SESSION['data'] ) && ! empty( $_SESSION['data'] ) ) { $fields['name'] = sanitize_text_field( $_SESSION['data']['data']['firstname'] . ' ' . $_SESSION['data']['data']['name'] ); $fields['email'] = sanitize_email( $_SESSION['data']['data']['email'] ); } return $fields; }Or should I be doing something with the $session variable
Also:
When both admin and API logged in, I get 500 internal server error. That shouldn’t be a problem because the admin doesn’t vote.Thanks for your reply. I installed the plugin, but I am not sure how I make it work from there. I am not able to store any user information on the website. So I am not really sure if I can create an WP_User instance with the API information.
Is there anyway I can pass on the session using Ajax?
I am sorry if this is not really plugin related.
Yes the session is filled with the data. But the users on my website don’t have a WordPress account. It looks like the filter below only works when an user is officially logged into WordPress.
add_filter( 'helpful_feedback_submit_fields', 'custom_function', PHP_INT_MAX );Could the be the problem?
Thanks for adapting the code. I tried it again but the feedback still shows as Anonymous for me. It works when I am also logged on an admin account.
function custom_function( $fields ) { if(isset($_SESSION['data'])) { $fields = array( "name" => $_SESSION['data']['data']['firstname'] . ' ' . $_SESSION['data']['data']['name'], "email" => $_SESSION['data']['data']['email'], ); return $fields; } } add_filter( 'helpful_feedback_submit_fields', 'custom_function' );This is the code I used and it works only when an user is admin logged in. The user data is stored in a session.
Hi Pixelbart, would love to hear from you if this is possible so I can keep making use of your plugin.
Hi Bart,
Thanks for your reply. I thought I had everything working until I realised it only worked when I was also logged in on an admin account. That’s when the helpful_feedback_submit_fields only seems to work.
Users on the website login with the credentials of a third party using an API. The account information is not stored in WordPress. For that reason I am not able to use is_user_logged_in right?
Is there anything else I can do to make this work? Thanks in advance!