“role” not shown
-
Hello, is there any particular reason why the basic field “role” is not showing in the user’s screen? If I use “capabilities” I just get a text like 1, 1, 1, 1.
I need a simple text undicating the user’s current capability.
-
Did you add the Role column in the ‘Default’ section? This is a column not managed by our plugin. We do have our own column ‘Roles’ which should be able to display multiple roles if available. I don’t know what you mean by the ‘Capabilities’ since I’m not aware of such a feature in our plugin.
what you mean by “default section”? the only mention of that is in the settings option to restore to default state.
I have added the “role column” as detected by the plugin, but it shows empty, whereas it should say author,contributor,subscriber, etc.When you restore the default state, you’ll get all the default WordPress columns. Our plugin does not change the value for those default columns. But we do have a custom Role columns. When you add a new column, you can select a column type.
When you open the drop-down, on top there are the default WordPress columns in the ‘Default’ section/group including the ‘Role’ columns. When you scroll down to the ‘Custom’ section/group, you will find our custom column called ‘Roles’. You could try to use that column instead of the default one.Hi Stefan, I’m not going to restore the default state because I have customized all my screens. Yet, adding the Role column from the “default” section is just what I did (for the User screen). But I don’t have Role in the “custom” section… that’s why something is missing
Ah sorry, it seems that the custom Roles column I mentioned is a Pro-only column, so I’m afraid that is not an option for you. If the default Role column is displaying something wrong, there is nothing I can do since that is really managed by WordPress and not by our plugin.
Sorry if I’m catching up again, but I think that AdminColumns has started failing. I have noticed that several of my columns don’t show data anymore, for instance “last login” or other custom-post-types that are found by the plugin but not output.
Is there some sort of debug/fix feature? It can’t entirely be a WP fault, can it?Don’t you have any data at all for those columns?
There were no recent changes to the plugin, and if it suddenly stopped working, I doubt that it is because of our plugin. Do you have this issue for specific column types? Like, are you using the Custom Field column?Usually I have no data, even if I tried using both the default suggested column (e.g “last login”) and custom field. If data appears is unreadable, like a series of numbers (“last login” would give “18 February 2021, 2021-18-02, 4, 07, 6, 2, 12, 2021, 17, 0“)
I wonder that maybe I have choosen wrong custom-fields because the ones I’m interested in have different names or are hidden (WordPress itself hides most of them in meta boxes). So, is there a function to show ALL available custom-fields/custom-post-types in Admin Column’s “Type”?
Only the custom field column can display fields that are available, and it even shows the hidden custom fields. (They are prefixed by an underscore). But in order to display those fields, you’ll need at least one post of the post type where you want to add the column with that specific custom field populated. Without any settings in the custom field column, it will display the raw value from the database. So it is worth checking if the value matches the values that you can find in your post meta table.
The confusion rises from the fact that AC detects the very custom-field in the Default section (for instance, “last login”, “role”, which are not custom-fields) so I wonder why it fails to show the content in the table (not even the raw value)
If you find those keys in the drop-down, then I’m positive that you have that key in the user meta table. The custom field column does not show anything else than custom fields in the dropdown. Aside from that, since ‘last login’ is not a default WordPress field, it does sound logical to store this in user meta. Can you do a search in your user meta table for those keys? I expect those are there and probably have not value for most of your users, resulting in no display value on the overview page.
mmh… I don’t see “last login” in the usermeta table and if I do a total search I get “wfls-last-login” which looks like a Wordfence table… that creates even more confusion. How do you explain, instead, a default field that doesn’t output the data?
The only explanation I have when a custom field does not display the data for a specific key is that the data is not available for that record (user ID) for the provided key. Last login is not a default field in WordPress, so I would expect it to be available in the Custom Field, but only if it is available. When you say the key can not be found in the usermeta table, I really don’t have a clue how this can happen.
I thank you very much for helping me, but I guess we cannot get any further ?? we are both clueless
- The topic ‘“role” not shown’ is closed to new replies.