Admin role not really admin

So i followed a tutorial to install wordpress offline in xampp. It's up and running but login doesn't seem to be a full admin. It says i don't have sufficient privileges when trying to install a plugin. And when trying to make a new page it only offers 'submit for review' I used phpmyadmin to insert a another user with user level 10 and wp_capabilities a:1{s:13:"administrator";s:1:"1";} but it still says i don't have the privileges. Any help? EDIT I just …
Category: Web

How to enable a site administrator to edit users in a WordPress network/ multisite setup?

I have a few sites in a network. I don't want the site administrators to manage things like network plugins, but I would like them to be able to edit profiles of all network users, not use those on their site. At the top of the /wp-admin/network/users.php file is this: if ( ! current_user_can( 'manage_network_users' ) ) wp_die( __( 'You do not have permission to access this page.' ) ); How can I grant site administrators priviledges to manage_network_users without …
Category: Web

Wordpress private post won't display to other admins

By default Wordpress private posts are visible to all admins right. But on this build for some reason private posts are only displaying (on the page) to the admin that created it. I'm perplexed. I need all admins to see the private posts displayed. This is a custom post type using a custom query so maybe there's something I did there. // query upcoming webinars - Sort by date from date Picker $args_upcoming = array( 'cat' => $thiscat_id, 'numberposts' => …
Category: Web

How to allow editor to edit privacy page / settings only?

In my WordPress installation (4.9.8.) the editor role isn't allowed to edit the privacy page. It would work with following in my functions.php: $role_object = get_role( 'editor' ); $role_object->add_cap( 'manage_privacy_options', true ); $role_object->add_cap( 'manage_options' ); // this needs to be active in order that before cap works But now the editor has lot more rights than just editing the privacy page. Is there another way to grant access to the editor user role with some lines of PHP code? As …
Category: Web

Setting user permissions per post

I am trying to assign privileges on posts on a per post basis. Essentially, I have a custom post type which have authors. They can edit their own posts. I then have another role, which should be able to edit a subset of those posts bases on a custom field or taxonomy. I can filter out the posts that appear in the backend using pre_get_posts, and applying a query based on the custom field. However I need to limit specifically …
Category: Web

Hide Posts In Back-end/Admin Based On User's (Pseudo) Privileges Controlled by ACF

I'd like to disable access to posts in the back-end/Admin from a user that doesn't have the privilege to view those posts. This will function similar to the Author role however this "privilege" is controlled by an ACF User relationship field and not by a WP Core role or privilege. One level of complexity deeper, the User relationship field is actually pointing to a parent/grouping custom post type that is then tied to the children post elements I'm attempting to …
Category: Web

MySQL Database User: Which Privileges are needed?

The short installation instruction for WordPress ("5 Minutes") state that: Create a database for WordPress on your web server, as well as a MySQL user who has all privileges for accessing and modifying it. While setting up a new blog professionally I was wondering how that maps to what the MySQL database user privileges/permissions configuration offers me: Data: SELECT, INSERT, UPDATE, DELETE Definition: CREATE, ALTER, DROP Extra: INDEX More: LOCK TABLES REFERENCES CREATE TEMPORARY TABLES CREATE VIEW SHOW VIEW CREATE …
Category: Web

New admin account cant access plugins.php

I am trying to add a plugin to a client's site. I can see everything in the dashboard except the plugin page and users pages. I can install a plugin and see my own profile but cant see other installed plugins or other user profiles in the dashboard. If i access the pages via direct link, i get an insufficient privileges to access this page error. Any idea? As requested... The values of my account in phpmyadmin: wp_capabilities = a:1:{s:13:"administrator" …
Category: Web

Hide top admin panel for non admin and non editors

So i came to three posible solutions to this question and can't decide which is better. What is your opinion? First solution: if ( ( in_array('administrator', userdata('role')) || in_array('editor', userdata('role')) ) == false) { add_filter('show_admin_bar', '__return_false'); } Second one: if( ( current_user_can('editor') || current_user_can('administrator') ) == false ) { add_filter('show_admin_bar', '__return_false'); } Third one: $allowed_roles = array('editor', 'administrator'); if( array_intersect($allowed_roles, userdata('role') ) == false ) { add_filter('show_admin_bar', '__return_false'); } User data function: function userdata($userdata){ $userinfo = wp_get_current_user(); if ($userdata == …
Category: Web

Excluding private/protected posts via IP

I essentially want password protected/private pages/posts in WP to work as they currently do, but completely disregard the functionality for certain IP addresses. I've looked into filters/actions and don't see anything that seems promising, again I would prefer to do this without creating a specific category or anything outside of the current functionality of this in wordpress. Thanks!
Category: Web

Forbid contributors viewing drafts

Is there any way I can forbid a contributor to view draft posts? Right now any contributor can view my draft posts and even edit them (however their edits must be approved by administrator first).
Category: Web

Add role privileges of the custom post type

I wonder if it is possible when adding a new role add_role() I can assign to it a privileges to add, edit, delete posts of a custom type. To be specific. I want to add a role 'volunteer coordinator' that can edit, add, delete events. Event is a custom post type. The things that I managed to do is to assign privileges as a editor but this only works on the posts and the pages but not a custom posts …
Category: Web

Why are authors allowed to approve comments on their posts? How to revoke privilege?

I was under the impression that only admins/editor roles can approve comments however our authors are able to do so as well on their own posts. I want to disable the ability for an author to approve comments on their posts. Under dashboard settings > discussions > Before a comment appears-- Selected: Comment must be manually approved Unselected: Comment author must have a previously approved comment
Category: Web

"You do not have sufficient permissions to access this page" upon accessing my newly created plugin page

I am following "Write your own plugin tutorial" and I made it, activated it, added it to settings to have it's own plugin page but upon trying to access that plugin page I get above message saying that "I do not have sufficient permissions to access this page" even though I am logged in as admin and I did chmod -R 777 to wordpress directory?? What else could it go wrong? Plugin code follows: oscommerce_importer.php <?php /* Plugin Name: OSCommerce …
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.