WordPress User Portal

Nevermind, turns out the Elementor Role Manager does pretty much this exactly by limiting out the more confusing or dangerous elements from being edited.

Some Admin disappeared

I’d look at your error.log file just after you access the admin page. I’d suspect that there is a plugin code that is failing on the admin page. The error log might point you to the culprit. Alternately, you could disable recently added/updated plugins by renaming that plugin’s folder (in wp-content/plugins folder), which will effectively … Read more

How to expire guest users after 1.5 hours logged in?

In your single.php template file: <?php if (has_post()) { the_post(); $user = wp_get_current_user(); $hasPermission = in_array(‘subscriber’, $user->roles); // or maybe instead of a role, you can check for your custom permission: // $hasPermission = current_user_can(‘view_access_codes’); $postTime = get_post_time(‘U’, true); $timeThreshold = time() – 60 * 60 * 1.5; $hasTimePassed = $postTime < $timeThreshold; if (!$hasPermission … Read more

How to get current user ID in array meta_value?

WP_User_Query is a user search. This sentence… But I need to echo only those users name whose meta_key= something but meta _value is equal to current user ID. … suggests that that is not really what you want. I think you can accomplish this with: $current_user = wp_get_current_user(); $meta = get_user_meta($current_user->ID, ‘Something’, true); if (!empty($meta)) … Read more

how to show logged in members username in wordpress content

It looks like $current_user->user_firstname contains some tag content. I would replace that line with: <h5>Hi <?php echo esc_html($current_user->user_firstname); ?></h5> or <h5>Hi <?php echo strip_tags($current_user->user_firstname); ?></h5> One of those (or either) may solve your problem outright.

Parse error: syntax error, unexpected ‘}’ in C:\wamp64\www\Proiect\aplicatie\user_check.php on line 18 [closed]

The semi-colons need to go inside the curly braces, to mark the ends of the array_push() statements: if(empty($username)) { array_push($errors, “Username is required”); } if(empty($email)) { array_push($errors, “Email is required”); } if(empty($password)) { array_push($errors, “Password is required”); } You don’t need semi-colons after the close braces.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)